-
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
Dropping a link follows it in Firefox. #3179
Comments
Adding |
This looks like a regression. I didn't have this problem on 11.x but it started happening after updating Seems similar to #221 which was fixed a long time ago. |
Another workaround is to set manually
|
I think this is happening because the If you mark an element as a drag source with All of the drag handling in the HTML5 backend treats custom drags and native drags as exclusive things, but in firefox, you could have a custom drag event firing that still has native drag data in the dataTransfer - the drop event there will act like a native drop in those cases. I've put up a PR that fixes the bug in Firefox for me, but I haven't tested it extensively with generic use cases. |
False alarm, works fine after upgrading also react-dnd-html5-backend to 14.0.1 |
Describe the bug
I have an
<a href="">
link element which I want to make also draggable. I had wrapped the link in a<span ref={drag}>
to be sure. Previously this was fine; clicking it works as a link, but it also instead can be dragged. However, after upgradingreact-dnd-html5-backend
to the latest 14.0.0, this no longer works; as soon as it is dropped over a qualified element, the link is immediately followed. Dropping it elsewhere does not cause this. I only see the wrong behavior in Firefox, not Chrome.I have traced it back to #2949. If I restore the
e.preventDefault()
inhandleTopDropCapture
, it works correctly. I don't understand the code well enough to diagnose further. Maybe somehow thatisDraggingNativeItem
has browser differences.Possibly related, but even the simple example here https://react-dnd.github.io/react-dnd/examples/dustbin/single-target does not work right for me in Firefox. When I drag into the box, the alert appears twice, whereas in Chrome it appears once. Furthermore, after the second alert, I get an "invariant violation" error in the console. This might not be the same problem, however.
Desktop (please complete the following information):
The text was updated successfully, but these errors were encountered: