-
-
Notifications
You must be signed in to change notification settings - Fork 604
-
-
Notifications
You must be signed in to change notification settings - Fork 604
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
Init error if no source nodes and using extension dnd5 #761
Comments
It seems there is no way to drag nodes from one tree and drop onto another tree that has no nodes anyway (I did a quick hack in dnd5 treeInit). Am always returning true in dragEnter() handler. |
For context, I am replicating the Chrome bookmark manager, and a folder could have no items in it. |
Thanks, the exception is a bug.
Currently true. For this, the container area could accept drop events and delegate them to the invisible root node. |
Thanks. I'm going to have a stab at fixing a few things tomorrow, there are some other errors as well. Was thinking about having the container accept drop events today, and will implement as suggested. Need the thing working asap and it's either fix this or implement my own in React, and I like a lot of the other features you've built. Will do a PR next week. |
@mar10 Making good progress on this. Initially just getting to work reliably in handling drag enter/over/drop on any empty space, defaulting to display marker at top, controlled by a dnd5.allowDropOnNonNode option (feel free to rename). Once it's solid, I'll logic to place marker before top node or after last node depending on pointer entering from top or bottom. I'm only modifying dnd5 as that's my immediate need, I will leave you to roll out changes to dnd to keep in sync. |
That's great news.
Maybe this is not even required, since above would mean that we already had a node there at the top, that then would already handle the drag events? |
I am closing this bug issue since it should be fixed now - would you open a new one for the feature request? |
Simply I need to render a Fancytree that may have no initial source e.g. no nodes.
When using extension 'dnd5' this results in an error as $scrollParent is empty (no children in $container), and subsequently results in an error in fn.scrollParent trying to access this[0].ownerDocument [triggered by code in dnd5 extension -> treeInit()]
The text was updated successfully, but these errors were encountered: