Drop Area: Fix dragging from the left side (#315)

This commit is contained in:
Abolfazl Omidvar 2023-11-12 12:26:09 +03:30 committed by GitHub
parent 62f742c023
commit 69694d1e54
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -71,7 +71,11 @@ const DropArea: FC<OwnProps> = ({
const { target: fromTarget, relatedTarget: toTarget } = e;
// Esc button pressed during drag event
if ((fromTarget as HTMLDivElement).matches('.DropTarget, .DropArea') && !toTarget) {
if (
(fromTarget as HTMLDivElement).matches('.DropTarget, .DropArea') && (
!toTarget || !(toTarget as HTMLDivElement)!.matches('.DropTarget, .DropArea')
)
) {
hideTimeoutRef.current = window.setTimeout(() => {
onHide();
}, DROP_LEAVE_TIMEOUT_MS);