-
-
Notifications
You must be signed in to change notification settings - Fork 299
Open
Description
Describe the bug
Panning does not work in external window.
To Reproduce
Steps to reproduce the behavior:
You can reproduce in https://codesandbox.io/s/still-leaf-t3shu (which is originally posted in #93)
Expected behavior
Panning should work in external window.
Additional context
I have done some test in cloned repo in dev mode, and I noticed diff in https://github.com/BetterTyped/react-zoom-pan-pinch/pull/448/files may not be correct change.
react-zoom-pan-pinch/src/core/pan/panning.utils.ts
Lines 19 to 28 in a0dac69
const targetIsShadowDom = "shadowRoot" in target && "composedPath" in event; | |
const isWrapperChild = targetIsShadowDom | |
? event.composedPath().some((el) => { | |
if (!(el instanceof Element)) { | |
return false; | |
} | |
return wrapperComponent?.contains(el); | |
}) | |
: wrapperComponent?.contains(target); |
in
operation returns true regardless of shadowRoot even though the value is null so I think nullability has to be checked.- If it's on the shadowRoot or external window,
instance of Element
is alwaysfalse
because every environment has its own internal class.
Metadata
Metadata
Assignees
Labels
No labels