Skip to content
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

dnd5: cannot drop "draggable" objects over nodes "moved To" new location #835

Closed
ziozione opened this issue Feb 5, 2018 · 1 comment
Closed

Comments

@ziozione
Copy link

ziozione commented Feb 5, 2018

Hello,
first of all, thank you very much for your fantastic FancyTree!
In my project, I am using Fancytree 2.26.0 and its drag&drop functionalities (dnd5) for building a tree from a grid containing the nodes to add; these items have "draggable" attribute.
All works wery well, and I am able to build trees from these data.

Unfortunately, I noted a bug that, for the final user, can be very disappointing.

If you perform a drag&drop of a node within the tree (i.e. if you move a node already in the tree in another position of the same tree), then the node (and sometimes also its direct father) becomes a "non-node" (from dnd5 point of view) and the user cannot drop "draggable" objects on it.
It seems that the "moveTo" function leaved the nodes in an inconsistent state.

But if you then perform a "false dnd" in the tree (i.e. drag a node, then drop it in a "not droppable" area, so the tree remains unchanged), the node (but I suspect, the entire tree) resets its status and the user can again drop a "draggable" on the same node that before refused it.
Of course, also saving the tree with the just moved node, then closing/reopening the page, allowed the user to drop "draggable" also over the same node that before refused it.

Of course, both these workarounds are not willing to be used in production environment.

In the "github_dnd5_bug_sample.html" attached file you can find a situation compatible with our production site (drag from a DataTables grid to a Fancytree).
Steps to reproduce the problem:

  1. Create folder "example" at the same level of "lib" and "src" folders of Fancytree distribution
  2. Copy github_dnd5_bug_sample.html into "example" folder
  3. open github_dnd5_bug_sample.html page in your browser (Chrome or Firefox)
  4. Drag some items from column "Name" of the table into the tree (i.e. as childs of "Drop here" node)
  5. Drag a tree node (let's name it "moved001") as child of another node
  6. Drag an item from column "Name" into the tree as child of "moved001" ---> the "forbidden" icon appear

You can verify this behavior also in the dnd5 demo page (http://wwwendt.de/tech/fancytree/demo/#sample-ext-dnd5.html).
Steps to reproduce the problem (dnd5 demo page):

  1. open dnd5 demo page in your browser (Chrome or Firefox)
  2. drag etc\init.d node as child of etc\cups node
  3. drag "Drag Me" div on "init.d" node --> the "forbidden" icon appear

Did someone can help me to find a (programmatical) fix to avoid to the final user the empirical workarounds I described above?
Thank you very much!

Best Regards
ZioZione

github_dnd5_bug_sample.zip

@mar10
Copy link
Owner

mar10 commented Feb 5, 2018

Thanks for reporting. There was a bug in dnd5 (did not reset the previous drag source, so an external draggable was considered a node)

@mar10 mar10 closed this as completed in 1ba7e13 Feb 5, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants