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

Missing Open Icon when adding new node #51

Open
cclzxl opened this issue Aug 27, 2021 · 1 comment
Open

Missing Open Icon when adding new node #51

cclzxl opened this issue Aug 27, 2021 · 1 comment

Comments

@cclzxl
Copy link

cclzxl commented Aug 27, 2021

Hello,

I would like to load child node when the parent node is clicked, because the size of tree is very large.

In the code below, I add a new child node "c" when clicking node "a", who has already a node named "b" and "b" has children as well.
When a is opened is selected, the open icon of "b" is disappared.

I'm working on Jupyter and chrome, ipytree version 0.2.1

from ipytree import Tree, Node

t = Tree(Stripes = True, multiple_selection=False)
a = Node("a")
t.add_node(a)
b = Node("b", [Node("f"), Node("g")])
b.opened = False
a.add_node(b)

def on_click_temp(event):
    if(event.name=="selected"):
        if (event["new"] == False)  and (event["old"] == True):
            return
    
    event["owner"].add_node(Node("c", [Node("d"), Node("e")]))

a.observe(on_click_temp, names=["selected"] )

t

image

@csadorf
Copy link

csadorf commented Jul 19, 2022

@martinRenou Any chance that this long-standing bug could be addressed?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants