From a7a716f161f8469584fcce72947b968c4c65279e Mon Sep 17 00:00:00 2001 From: Alexander Zinchuk Date: Mon, 30 Jan 2023 15:55:27 +0100 Subject: [PATCH] Attachment Modal: Fix drag and drop (#2414) --- src/components/middle/composer/AttachmentModal.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/components/middle/composer/AttachmentModal.tsx b/src/components/middle/composer/AttachmentModal.tsx index 12ed112b2..59242afc8 100644 --- a/src/components/middle/composer/AttachmentModal.tsx +++ b/src/components/middle/composer/AttachmentModal.tsx @@ -233,12 +233,12 @@ const AttachmentModal: FC = ({ 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; }