diff --git a/CHANGELOG.md b/CHANGELOG.md index 5541621d68..a2f94be0a4 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -114,6 +114,7 @@ Notes: web developers are advised to use [`~` (tilde range)](https://github.com/ - Fixed math parsing that could cause Web Chat to hang when processing certain LaTeX expressions, in PR [#5377](https://github.com/microsoft/BotFramework-WebChat/pull/5377), by [@OEvgeny](https://github.com/OEvgeny) - Fixed long math formula should be scrollable, in PR [#5380](https://github.com/microsoft/BotFramework-WebChat/pull/5380), by [@compulim](https://github.com/compulim) - Fixed [#4948](https://github.com/microsoft/BotFramework-WebChat/issues/4948). Microphone should stop after initial silence, in PR [#5385](https://github.com/microsoft/BotFramework-WebChat/pull/5385) +- Fixed [#5390](https://github.com/microsoft/BotFramework-WebChat/issues/5390). Fixed drop zone remaining visible when file is dropped outside of the zone, in PR [#5394](https://github.com/microsoft/BotFramework-WebChat/pull/5394), by [@OEvgeny](https://github.com/OEvgeny) # Removed diff --git a/packages/fluent-theme/src/components/dropZone/DropZone.tsx b/packages/fluent-theme/src/components/dropZone/DropZone.tsx index d39300d491..0923033ff4 100644 --- a/packages/fluent-theme/src/components/dropZone/DropZone.tsx +++ b/packages/fluent-theme/src/components/dropZone/DropZone.tsx @@ -67,14 +67,16 @@ const DropZone = (props: { readonly onFilesAdded: (files: File[]) => void }) => setDropZoneState(false); }; - document.addEventListener('dragenter', handleDragEnter, false); - document.addEventListener('dragleave', handleDragLeave, false); - document.addEventListener('dragend', handleDragEnd, false); + document.addEventListener('dragenter', handleDragEnter); + document.addEventListener('dragleave', handleDragLeave); + document.addEventListener('dragend', handleDragEnd); + document.addEventListener('drop', handleDragEnd, true); return () => { document.removeEventListener('dragenter', handleDragEnter); document.removeEventListener('dragleave', handleDragLeave); document.removeEventListener('dragend', handleDragEnd); + document.removeEventListener('drop', handleDragEnd); }; }, [setDropZoneState]);