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

Dragged objects are stuck to mouse after forced page focus change (e.g. taking a screenshot) #962

Open hybridherbst opened 2 years ago

hybridherbst commented 2 years ago

Expected behavior

Dragged objects should only ever follow the mouse if the mouse is clicked. However, it seems that certain interactions (such as taking a screenshot while dragging) will put the object into an incorrect state where it's dragged around despite the mouse not being clicked.

Actual behavior

Object is "stuck" to mouse despite no click 20220407-230327-xK1P-chrome_rCiW

System configuration

interact.js version: latest Browser name and version: Chrome, Firefox Operating System: Windows

Additional Info

taye commented 2 years ago

Do you have examples of other times this can happen?

As far as I'm aware, the lib listens for all of the relevant events that should end a drag - blur, pointerup, pointercancel and the mouse and touch equivalent when appropriate.

hybridherbst commented 2 years ago

It also happens when

20220407-232914-2NYl-Code_hcUj

stale[bot] commented 2 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

hybridherbst commented 2 years ago

This issue is still present.

taye commented 2 years ago

Those demos are in iframes, so there's no mouse up coming from the parent window when you click the scrollbars. If they weren't in the iframe, I think it wouldn't be so bad. I don't think there's much that can be done about this issue on WIndows. Have you checked what happens with other drag and drop libs when they're in iframes?