From f531427f2de9976896c5dc94463649fe1faeddfc Mon Sep 17 00:00:00 2001 From: sasza Date: Thu, 1 Feb 2024 16:45:35 +0100 Subject: [PATCH] fix: fix for css styles when having multiple instances of panzoom grid in on screen (selecting elements in one grid was outlining elements in another) --- .changeset/five-clouds-visit.md | 5 +++++ src/Styles.tsx | 25 +++++++++++++++---------- src/hooks/useGrabElement.ts | 4 ++-- 3 files changed, 22 insertions(+), 12 deletions(-) create mode 100644 .changeset/five-clouds-visit.md diff --git a/.changeset/five-clouds-visit.md b/.changeset/five-clouds-visit.md new file mode 100644 index 0000000..c28123d --- /dev/null +++ b/.changeset/five-clouds-visit.md @@ -0,0 +1,5 @@ +--- +"react-grid-panzoom": patch +--- + +fix for css styles when having multiple instances of panzoom grid in on screen (selecting elements in one grid was outlining elements in another) diff --git a/src/Styles.tsx b/src/Styles.tsx index 5571d4b..3c3e046 100644 --- a/src/Styles.tsx +++ b/src/Styles.tsx @@ -2,6 +2,10 @@ import React, { memo } from 'react'; import Style from './Style'; +const ACTION_MOVING = '.react-panzoom--element-moving .react-panzoom--element-moving-in'; +const ACTION_RESIZING = '.react-panzoom--element-resizing .react-panzoom--element-resizing-in'; +const ELEMENT_NOT_DISABLED = '.react-panzoom-element:not(.react-panzoom-element--disabled)'; + const Styles = () => (