Skip to content

Commit fa15d7d

Browse files
committed
WIP: update remove node logic when root is removed
1 parent d183f41 commit fa15d7d

File tree

1 file changed

+5
-0
lines changed
  • src/main/java/com/flowingcode/vaadin/addons/orgchart

1 file changed

+5
-0
lines changed

src/main/java/com/flowingcode/vaadin/addons/orgchart/OrgChart.java

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -570,6 +570,11 @@ public void removeNodes(Integer nodeId) {
570570
parentNode.setChildren(currentChildren);
571571
}
572572

573+
// If removing the root, clear internal root reference
574+
if (this.orgChartItem != null && nodeId.equals(this.orgChartItem.getId())) {
575+
this.orgChartItem = null;
576+
}
577+
573578
// Update the visual representation
574579
this.getElement().executeJs("this.removeNodes($0)", nodeId);
575580
}

0 commit comments

Comments
 (0)