ipytree icon indicating copy to clipboard operation
ipytree copied to clipboard

Missing Open Icon when adding new node

Open cclzxl opened this issue 4 years ago • 1 comments
trafficstars

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

cclzxl avatar Aug 27 '21 15:08 cclzxl

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

csadorf avatar Jul 19 '22 12:07 csadorf