-
Notifications
You must be signed in to change notification settings - Fork 2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Editor: Track elements for more reliable drag detection #550
Conversation
👍 |
I think I may have found a little edge case here, but verified it breaks in production too - so I suppose this could be fixed here since it is on-topic or in a subsequent PR. I can get the drop-zone "stuck" by doing the following - tested in Safari only:
Note these images are on my desktop, but I also did notice it with the dragging from my downloads drawer in the dock :) |
👍 Looks good. I assume there were some issues using the |
4664e17
to
74d26d7
Compare
Thanks for the reviews, @timmyc and @gwwar ! @timmyc : Can you try again with 85fff41 ? I suspect what was happening is that the @gwwar : If I recall correctly, I had seen that sometimes multiple of the same events were being fired consecutively, which seems like buggy browser behavior. Regardless, I think this is a much more reliable approach than simply incrementing and decrementing a counter based on the events received. Your suggestion of resetting the state on |
@aduth 👍 confirmed that mouseup unsticks the blue dropzone. This can be tested with FF and pressing esc to cancel the drop event, to get the editor into a stuck state. A mouse click on the editor will remove the blue dropzone. Being able to unstick the editor is good enough to 🚢 in my opinion. There will likely be other corner cases/browser combos that trigger this. |
74d26d7
to
f8091ad
Compare
…cking Editor: Track elements for more reliable drag detection
Fixes #508
Fixes #359
This pull request seeks to resolve an issue where dragging an item could intermittently cause the drag detection to become stuck after moving the cursor away from the page.
Implementation notes:
In my testing, I had found that sometimes the previous implementation would incorrectly become stuck with an inaccurate "drag counter" when multiple consecutive drag incrementing (
dragenter
) events were triggered on an element. This pull request changes the implementation to track elements known to be dragged over, rather than increment a simple counter. This results in more stable tracking, as even if multiple events were fired against the same element, it would be included in the set of tracked elements only once.Testing instructions:
The following cases have been observed to have sometimes caused a "stuck":
iframe
. There is special treatment for faking a drag event atop the editoriframe
.Verify that drag detection is tracked correctly in your preferred browser.