Skip to content
This repository was archived by the owner on May 20, 2023. It is now read-only.

Commit 10cd005

Browse files
Googlernshahan
authored andcommitted
Bugfix for tree selection auto selection all siblings due to an error being thrown which stops event.stopPropagation from firing.
PiperOrigin-RevId: 186694928
1 parent 6cb1e15 commit 10cd005

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

lib/model/selection/tree_selection_mixin.dart

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,9 @@ abstract class TreeSelectionMixin<T>
3434
Set<T> visited = new Set<T>();
3535

3636
visited.add(e);
37-
parentsToCheck.add(e);
37+
if (hasChildren(e)) {
38+
parentsToCheck.add(e);
39+
}
3840

3941
Map<T, List<OptionGroup<T>>> hierarchyMap = getHierarchyMap();
4042

@@ -45,9 +47,9 @@ abstract class TreeSelectionMixin<T>
4547
optionGroup.toList().forEach((item) {
4648
if (!visited.contains(item)) {
4749
allChildren.add(item);
50+
visited.add(item);
4851
if (hasChildren(item)) {
4952
parentsToCheck.add(item);
50-
visited.add(item);
5153
}
5254
}
5355
});

0 commit comments

Comments
 (0)