-
Notifications
You must be signed in to change notification settings - Fork 187
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
Drag and Drop from tree to other container not working in Firefox any more #161
Comments
Thanks @BjrnS for the test case, we'll look into this as soon as possible. |
may I ask if you still plan to look into it and ideally if a fix will be coming? |
Hi @BjrnS, I am looking at it now. So far, it looks like basic Dojo Dnd is working in Firefox: <div>Pick here:</div>
<ol class="box" data-dojo-type="dojo/dnd/Source">
<li class="dojoDndItem">Item 1</li>
<li class="dojoDndItem">Item 2</li>
<li class="dojoDndItem">Item 3</li>
</ol>
<div>Drop here:</div>
<ol class="box" data-dojo-type="dojo/dnd/Target">
</ol> I'll dive into the test case and see if I can figure out what's broken. |
Here is what I know... In Firefox, when you click on an item and start dragging, this event handler fires for ALL mouse movements even when the point moves outside of the container node: Line 47 in 4178582
In Chrome, that event handler stops firing as soon as the mouse leaves the tree container node. So in Firefox, the Dojo/Dijit code receives no other events as you drag an item in the tree to another container. Drag and drop works within the tree because that event handler handles movement within the tree. I've tried to replicate this problem with a simpler test case without success. My thought was if this is a Firefox bug, I would need a much simpler test case to demonstrate it. |
the root cause may be related to a known bug in dojo/touch, see https://dojotoolkit.org/reference-guide/1.10/dojo/touch.html if I disable the touch screen, drag and drop works for me in firefox and chrome. |
This can be fixed with some CSS: .dijitTree {
-moz-user-select: none;
} We are working on fixing this in Dijit. |
dijit/Tree and dojo/dnd/Manager both have selectstart handlers that prevent selection, and they are generally working. In Firefox, although the events fire and prevent actual content selection, they mess up mouse events to the point that while the canceled selection is happening the target for all pointer events is the node in which selection started. So when you drag an item out of the tree and into a DnD target, Firefox doesn't register that happening as it thinks you're still selecting things in the Tree.
dijit/Tree and dojo/dnd/Manager both have selectstart handlers that prevent selection, and they are generally working. In Firefox, although the events fire and prevent actual content selection, they mess up mouse events to the point that while the canceled selection is happening the target for all pointer events is the node in which selection started. So when you drag an item out of the tree and into a DnD target, Firefox doesn't register that happening as it thinks you're still selecting things in the Tree.
Hi,
since a few Firefox versions it is not possible to drag a node out of a tree onto another dojo/dnd/Source element to drop it there. The drop allowed indicator does not appear, releasing the mouse button over the element acts as if the mouse is over any other non-dnd element.
Dnd within the tree works, so it seems like it is not a general problem.
With Chrome and Edge the mechanism works as intended.
Observations:
e.stopPropagation(); e.preventDefault();
indojo/dnd
anddijit/tree
might be responsible, but had no luck with that approachthe issue was reported here: https://discourse.dojo.io/t/drag-and-drop-not-working-with-firefox-dojo-1-13/201 as well.
I have hacked together a single page example of the issue, you can reach it here: https://misc.digicult-verbund.de/tests/ff_tree.html
The text was updated successfully, but these errors were encountered: