Attachment Modal: Fix drag and drop (#2414)
This commit is contained in:
parent
6b5b9d7a2f
commit
a7a716f161
@ -233,12 +233,12 @@ const AttachmentModal: FC<OwnProps & StateProps> = ({
|
||||
const { relatedTarget: toTarget, target: fromTarget } = e;
|
||||
|
||||
// Esc button pressed during drag event
|
||||
if ((fromTarget as HTMLDivElement).matches(styles.dropTarget) && !toTarget) {
|
||||
if ((fromTarget as HTMLDivElement).matches(`.${styles.dropTarget}`) && !toTarget) {
|
||||
hideTimeoutRef.current = window.setTimeout(unmarkHovered, DROP_LEAVE_TIMEOUT_MS);
|
||||
}
|
||||
|
||||
// Prevent DragLeave event from firing when the pointer moves inside the AttachmentModal drop target
|
||||
if (fromTarget && (fromTarget as HTMLElement).closest(styles.hovered)) {
|
||||
if (fromTarget && (fromTarget as HTMLElement).closest(`.${styles.hovered}`)) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user