From 245c70b541123e9b7d98c275bdb1bb5af3d904a4 Mon Sep 17 00:00:00 2001 From: Eugene Date: Mon, 16 Dec 2024 20:09:37 +0000 Subject: [PATCH 1/2] fix: dropping file out of drop zone makes it stuck in visible state --- .../fluent-theme/src/components/dropZone/DropZone.tsx | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) 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]); From 94899b91fda4206e7f993b405a7a5e3886f2c1d9 Mon Sep 17 00:00:00 2001 From: Eugene Date: Mon, 16 Dec 2024 20:20:50 +0000 Subject: [PATCH 2/2] Changelog --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) 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