taye / interact.js

JavaScript drag and drop, resizing and multi-touch gestures with inertia and snapping for modern browsers (and also IE9+)
http://interactjs.io/
MIT License
12.32k stars 783 forks source link

Drop event triggered outside intended dropzone #1048

Open imReCoder opened 2 months ago

imReCoder commented 2 months ago

I am experiencing an issue where the drop event is being triggered within an iframe dropzone even when the draggable element is dropped outside the iframe. This behavior occurs when the sidebar (containing the draggable element) is positioned to the left of the iframe. When the sidebar is moved to the right, the issue resolves itself.

Steps to Reproduce:

Create a container with a sidebar and an iframe side by side. Add a draggable element to the sidebar. Add a dropzone within the iframe. Start dragging the element from the sidebar. Drop the element outside the iframe.

Expected Behavior: The drop event should only be triggered within the intended dropzone inside the iframe.

Actual Behavior: The drop event is being triggered within the iframe dropzone even when the draggable element is dropped outside the iframe.

Code Example: CodePen Example

Additional Information: This issue occurs when the sidebar is positioned to the left of the iframe. Moving the sidebar to the right resolves the issue.