|
@@ -917,8 +917,16 @@ class App extends React.Component<AppProps, AppState> {
|
|
|
window.removeEventListener(EVENT.RESIZE, this.onResize, false);
|
|
|
window.removeEventListener(EVENT.UNLOAD, this.onUnload, false);
|
|
|
window.removeEventListener(EVENT.BLUR, this.onBlur, false);
|
|
|
- window.removeEventListener(EVENT.DRAG_OVER, this.disableEvent, false);
|
|
|
- window.removeEventListener(EVENT.DROP, this.disableEvent, false);
|
|
|
+ this.excalidrawContainerRef.current?.removeEventListener(
|
|
|
+ EVENT.DRAG_OVER,
|
|
|
+ this.disableEvent,
|
|
|
+ false,
|
|
|
+ );
|
|
|
+ this.excalidrawContainerRef.current?.removeEventListener(
|
|
|
+ EVENT.DROP,
|
|
|
+ this.disableEvent,
|
|
|
+ false,
|
|
|
+ );
|
|
|
|
|
|
document.removeEventListener(
|
|
|
EVENT.GESTURE_START,
|
|
@@ -987,8 +995,16 @@ class App extends React.Component<AppProps, AppState> {
|
|
|
window.addEventListener(EVENT.RESIZE, this.onResize, false);
|
|
|
window.addEventListener(EVENT.UNLOAD, this.onUnload, false);
|
|
|
window.addEventListener(EVENT.BLUR, this.onBlur, false);
|
|
|
- window.addEventListener(EVENT.DRAG_OVER, this.disableEvent, false);
|
|
|
- window.addEventListener(EVENT.DROP, this.disableEvent, false);
|
|
|
+ this.excalidrawContainerRef.current?.addEventListener(
|
|
|
+ EVENT.DRAG_OVER,
|
|
|
+ this.disableEvent,
|
|
|
+ false,
|
|
|
+ );
|
|
|
+ this.excalidrawContainerRef.current?.addEventListener(
|
|
|
+ EVENT.DROP,
|
|
|
+ this.disableEvent,
|
|
|
+ false,
|
|
|
+ );
|
|
|
}
|
|
|
|
|
|
componentDidUpdate(prevProps: AppProps, prevState: AppState) {
|