Skip to content

Commit ae69d04

Browse files
authored
Fluent: improve dropzone (#5328)
* Fluent: improve dropzone * Changelog
1 parent 7f4b09c commit ae69d04

File tree

4 files changed

+10
-2
lines changed

4 files changed

+10
-2
lines changed

CHANGELOG.md

+1
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,7 @@ Notes: web developers are advised to use [`~` (tilde range)](https://github.com/
7272
- Resolved [#4847](https://github.com/microsoft/BotFramework-WebChat/issues/4847). Migrated to npm workspaces from lerna, in PR [#5301](https://github.com/microsoft/BotFramework-WebChat/pull/5301), by [@compulim](https://github.com/compulim)
7373
- Resolved [#5302](https://github.com/microsoft/BotFramework-WebChat/issues/5302). Migrated to `core-js-pure/Promise.withResolveers` from `p-defer`, in PR [#5301](https://github.com/microsoft/BotFramework-WebChat/pull/5301), by [@compulim](https://github.com/compulim)
7474
- Improved message bubble layout in Fluent theme to allow growth beyond 450px up to 75% of container width, in PR [#5324](https://github.com/microsoft/BotFramework-WebChat/pull/5324), by [@OEvgeny](https://github.com/OEvgeny)
75+
- Improved drop zone behavior and styling in Fluent theme, in PR [#5328](https://github.com/microsoft/BotFramework-WebChat/pull/5328), by [@OEvgeny](https://github.com/OEvgeny)
7576

7677
### Fixed
7778

packages/fluent-theme/src/components/dropZone/DropZone.module.css

+2-2
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,11 @@
88
place-content: center;
99
place-items: center;
1010
position: absolute;
11+
transition: all var(--webchat-durationNormal) var(--webchat-curveDecelerateMid);
1112
}
1213

1314
:global(.webchat-fluent) .sendbox__attachment-drop-zone--droppable {
14-
background-color: #e00;
15-
color: White;
15+
background-color: var(--webchat-colorBrandBackground2Hover);
1616
}
1717

1818
:global(.webchat-fluent) .sendbox__attachment-drop-zone-icon {

packages/fluent-theme/src/components/dropZone/DropZone.tsx

+7
Original file line numberDiff line numberDiff line change
@@ -62,12 +62,19 @@ const DropZone = (props: { readonly onFilesAdded: (files: File[]) => void }) =>
6262

6363
const handleDragLeave = () => --entranceCounter <= 0 && setDropZoneState(false);
6464

65+
const handleDragEnd = () => {
66+
entranceCounter = 0;
67+
setDropZoneState(false);
68+
};
69+
6570
document.addEventListener('dragenter', handleDragEnter, false);
6671
document.addEventListener('dragleave', handleDragLeave, false);
72+
document.addEventListener('dragend', handleDragEnd, false);
6773

6874
return () => {
6975
document.removeEventListener('dragenter', handleDragEnter);
7076
document.removeEventListener('dragleave', handleDragLeave);
77+
document.removeEventListener('dragend', handleDragEnd);
7178
};
7279
}, [setDropZoneState]);
7380

0 commit comments

Comments
 (0)