fix(Tree): suppress deselect event dispatch when switching nodes

Previously node_click_handle dispatched node_selected(false) for old node
before dispatching node_selected(true) for new node, causing apps to briefly
show old content. Now only visually deselects old node, dispatches only for
new selection.
This commit is contained in:
yumoqing 2026-07-27 18:35:08 +08:00
parent 33409eb634
commit bc3c4525fd

View File

@ -533,8 +533,8 @@ bricks.Tree = class extends bricks.VScrollPanel {
}
}
node_click_handle(node, event){
if (this.selected_node){
this.node_selected(this.selected_node, false);
if (this.selected_node && this.selected_node != node){
this.selected_node.selected(false);
}
if (this.selected_node == node && !this.opts.select_only){
this.selected_node = null;