mirror of
https://github.com/excalidraw/excalidraw.git
synced 2025-04-14 16:40:58 -04:00
fix: Scope drag and drop events to Excalidraw container to prevent overriding the host drag and drop events (#4445)
* cross-env
* reverting lib
https://github.com/excalidraw/excalidraw/issues/4282
* Revert "reverting lib"
This reverts commit 840726806a
.
* Update package.json
* Update App.tsx
* Update App.tsx
* lint
* updated changelog
* Update src/packages/excalidraw/CHANGELOG.md
Co-authored-by: Aakansha Doshi <aakansha1216@gmail.com>
* Update src/packages/excalidraw/CHANGELOG.md
* Move fixes above build header
* Update src/packages/excalidraw/CHANGELOG.md
* lint
Co-authored-by: Aakansha Doshi <aakansha1216@gmail.com>
Co-authored-by: David Luzar <luzar.david@gmail.com>
This commit is contained in:
parent
25e54e5999
commit
c76784b774
2 changed files with 24 additions and 4 deletions
|
@ -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) {
|
||||
|
|
|
@ -64,6 +64,10 @@ Please add the latest change on the top under the correct section.
|
|||
|
||||
The `Appearance` type is now removed and renamed to `Theme` so `Theme` type needs to be used.
|
||||
|
||||
### Fixes
|
||||
|
||||
- Scope drag and drop events to Excalidraw container to prevent overriding host application drag and drop events.
|
||||
|
||||
### Build
|
||||
|
||||
- Remove `file-loader` so font assets are not duplicated by webpack and use webpack asset modules for font generation [#4380](https://github.com/excalidraw/excalidraw/pull/4380)
|
||||
|
|
Loading…
Add table
Reference in a new issue