angular-ui-tree/angular-ui-tree

Can't drop nodes onto an empty tree, placeholder blocks it.

Opened this issue · 4 comments

I have tested it on the demo page, and both in connected trees and in cloning, if you delete all nodes on tree2, you can't drop the first tree nodes onto it. So far I've figured that if I increase the padding size of the tree div with css, I can now drop nodes onto the new extended part, but not onto the placeholder image.

If you are having this problem, I recommend using the directive data-empty-placeholder-enabled="false", and style the element with ui-tree directive to have an appropriate size.
there is probably some better way to workaround this, like overriding css of the placeholder class, but i'm not proficient enough to figure it out.

I guess you have the same issue as addressed in #755
It was fixed but for some reason now is not included in v2.17, you can patch it by introducing the code that fixes it, described in https://github.com/angular-ui-tree/angular-ui-tree/pull/738/files

#755 code is in the current version of this module. Does that code fix the issue or is PR #738 still needed?

Hi @jacobscarter ,
I don't see this code mentioned in the current version.
There was a fix in
https://github.com/angular-ui-tree/angular-ui-tree/pull/738/files#r60955690

with code:

 elementIsEmptyTree: function (element) {
    return element.attr('class') == "angular-ui-tree-empty";

but in the current release doesn't appear, not in
https://github.com/angular-ui-tree/angular-ui-tree/blob/master/source/services/helper.js

neither in

https://github.com/angular-ui-tree/angular-ui-tree/blob/master/dist/angular-ui-tree.js

maybe I'm missing something?? I added this code manually as a patch and it works.

Best

Roger that, I don't see it in there either, we will get #738 reviewed and merged in ASAP