fix: make leaveWhileDragging toggled only on dragging

This commit is contained in:
p-sw 2024-06-01 20:40:44 +09:00
parent ce9ad634f0
commit 92eeed2700

View File

@ -304,9 +304,11 @@ const DrawerContent = forwardRef<HTMLDivElement, DrawerContentProps>(
}} }}
onMouseDown={onMouseDown} onMouseDown={onMouseDown}
onMouseLeave={() => onMouseLeave={() =>
dragState.isDragging &&
setState((prev) => ({ ...prev, leaveWhileDragging: true })) setState((prev) => ({ ...prev, leaveWhileDragging: true }))
} }
onMouseEnter={() => onMouseEnter={() =>
dragState.isDragging &&
setState((prev) => ({ ...prev, leaveWhileDragging: false })) setState((prev) => ({ ...prev, leaveWhileDragging: false }))
} }
/> />