Skip to content

Commit

Permalink
fix #924 TreeGrid expand all crashes
Browse files Browse the repository at this point in the history
  • Loading branch information
vegegoku committed May 6, 2024
1 parent cd52a72 commit 8759ff9
Showing 1 changed file with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -335,9 +335,11 @@ private void expand(TableRow<T> row, boolean recursive) {
Optional<TreeGridRowToggleIcon> iconMeta = row.getMeta(TREE_GRID_ROW_TOGGLE_ICON);
iconMeta.ifPresent(
meta -> {
ToggleIcon<?, ?> icon = Js.uncheckedCast(meta.icon);
if (!icon.isToggled()) {
icon.toggle();
if (!row.getChildren().isEmpty()) {
ToggleIcon<?, ?> icon = Js.uncheckedCast(meta.icon);
if (!icon.isToggled()) {
icon.toggle();
}
}
});
}
Expand All @@ -355,8 +357,6 @@ private void showRow(TableRow<T> row) {
* Collapses a specific TableRow, hiding it, and optionally collapsing its child rows recursively.
*
* @param row The TableRow to collapse.
* @param recursive If true, child rows are collapsed recursively; otherwise, only the direct
* child rows are collapsed.
*/
private void collapse(TableRow<T> row) {
this.dataTable.fireTableEvent(new TreeRowOnBeforeCollapseEvent<>(row));
Expand Down

0 comments on commit 8759ff9

Please sign in to comment.