Compare commits
3 Commits
master
...
zsviczian-
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
19a5e0bf86 | ||
|
|
42fe6c2632 | ||
|
|
1098a0b909 |
@ -2737,12 +2737,6 @@ class App extends React.Component<AppProps, AppState> {
|
||||
addEventListener(window, EVENT.RESIZE, this.onResize, false),
|
||||
addEventListener(window, EVENT.UNLOAD, this.onUnload, false),
|
||||
addEventListener(window, EVENT.BLUR, this.onBlur, false),
|
||||
addEventListener(
|
||||
this.excalidrawContainerRef.current,
|
||||
EVENT.WHEEL,
|
||||
this.handleWheel,
|
||||
{ passive: false },
|
||||
),
|
||||
addEventListener(
|
||||
this.excalidrawContainerRef.current,
|
||||
EVENT.DRAG_OVER,
|
||||
@ -11165,9 +11159,20 @@ class App extends React.Component<AppProps, AppState> {
|
||||
event: WheelEvent | React.WheelEvent<HTMLDivElement | HTMLCanvasElement>,
|
||||
) => {
|
||||
// if not scrolling on canvas/wysiwyg, ignore
|
||||
const path = (event as any).composedPath?.() as EventTarget[] | undefined;
|
||||
const isOnExcalidrawCanvas =
|
||||
path?.some(
|
||||
(n) =>
|
||||
n instanceof HTMLCanvasElement &&
|
||||
n.classList?.contains("excalidraw__canvas"),
|
||||
) ||
|
||||
(event.target as Element | null)?.closest?.(
|
||||
"canvas.excalidraw__canvas",
|
||||
) != null;
|
||||
|
||||
if (
|
||||
!(
|
||||
event.target instanceof HTMLCanvasElement ||
|
||||
isOnExcalidrawCanvas ||
|
||||
event.target instanceof HTMLTextAreaElement ||
|
||||
event.target instanceof HTMLIFrameElement
|
||||
)
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user