Skip to content

Commit

Permalink
fix: Remove search-specific properties from nodes on clear
Browse files Browse the repository at this point in the history
  • Loading branch information
miruskin committed Apr 28, 2020
1 parent ac461d4 commit 761fd0f
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -154,6 +154,8 @@ class DropdownTreeSelect extends Component {
searchModeOn,
allNodesHidden,
})

if (value.length === 0) this.setState(this.resetSearchState())
}

onTagRemove = (id, isKeyboardEvent) => {
Expand Down
3 changes: 3 additions & 0 deletions src/tree-manager/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,9 @@ class TreeManager {
restoreNodes() {
this.tree.forEach(node => {
node.hide = false
node._isMatch = undefined
node.matchInParent = undefined
node.matchInChildren = undefined
})

return this.tree
Expand Down

0 comments on commit 761fd0f

Please sign in to comment.