Compare commits

...

3 Commits

Author SHA1 Message Date
zsviczian
19a5e0bf86
a more robust check 2025-08-20 19:36:26 +02:00
zsviczian
42fe6c2632
Update App.tsx 2025-08-20 19:17:02 +02:00
zsviczian
1098a0b909
check for activeEmbeddable in handleWheel 2025-08-20 18:59:52 +02:00

View File

@ -2737,12 +2737,6 @@ class App extends React.Component<AppProps, AppState> {
addEventListener(window, EVENT.RESIZE, this.onResize, false), addEventListener(window, EVENT.RESIZE, this.onResize, false),
addEventListener(window, EVENT.UNLOAD, this.onUnload, false), addEventListener(window, EVENT.UNLOAD, this.onUnload, false),
addEventListener(window, EVENT.BLUR, this.onBlur, false), addEventListener(window, EVENT.BLUR, this.onBlur, false),
addEventListener(
this.excalidrawContainerRef.current,
EVENT.WHEEL,
this.handleWheel,
{ passive: false },
),
addEventListener( addEventListener(
this.excalidrawContainerRef.current, this.excalidrawContainerRef.current,
EVENT.DRAG_OVER, EVENT.DRAG_OVER,
@ -11165,9 +11159,20 @@ class App extends React.Component<AppProps, AppState> {
event: WheelEvent | React.WheelEvent<HTMLDivElement | HTMLCanvasElement>, event: WheelEvent | React.WheelEvent<HTMLDivElement | HTMLCanvasElement>,
) => { ) => {
// if not scrolling on canvas/wysiwyg, ignore // 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 ( if (
!( !(
event.target instanceof HTMLCanvasElement || isOnExcalidrawCanvas ||
event.target instanceof HTMLTextAreaElement || event.target instanceof HTMLTextAreaElement ||
event.target instanceof HTMLIFrameElement event.target instanceof HTMLIFrameElement
) )