Skip to content

Commit

Permalink
feat: deselect all nodes when switching to single or none selection mode
Browse files Browse the repository at this point in the history
This change ensures that when the selection mode of the TreeView is changed to single or none, all previously selected nodes are deselected. This provides a consistent and predictable behavior for these selection modes.
  • Loading branch information
dingyi222666 committed Nov 28, 2024
1 parent 2a5d708 commit 6643c90
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -501,7 +501,7 @@ class TreeView<T : Any>(context: Context, attrs: AttributeSet?, defStyleAttr: In
return
}
coroutineScope.launch {
if (old !== SelectionMode.NONE) {
if (new == SelectionMode.SINGLE || new == SelectionMode.NONE) {
tree.selectAllNode(false)
}
refresh(true)
Expand Down

0 comments on commit 6643c90

Please sign in to comment.