File tree Expand file tree Collapse file tree 1 file changed +14
-11
lines changed Expand file tree Collapse file tree 1 file changed +14
-11
lines changed Original file line number Diff line number Diff line change @@ -148,18 +148,21 @@ class DropdownTreeSelect extends Component {
148148 }
149149
150150 onInputChange = value => {
151- const { allNodesHidden, tree } = this . treeManager . filterTree (
152- value ,
153- this . props . keepTreeOnSearch ,
154- this . props . keepChildrenOnSearch
155- )
156151 const searchModeOn = value . length > 0
157-
158- this . setState ( {
159- tree,
160- searchModeOn,
161- allNodesHidden,
162- } )
152+ if ( ! searchModeOn ) {
153+ this . setState ( this . resetSearchState ( ) )
154+ } else {
155+ const { allNodesHidden, tree } = this . treeManager . filterTree (
156+ value ,
157+ this . props . keepTreeOnSearch ,
158+ this . props . keepChildrenOnSearch
159+ )
160+ this . setState ( {
161+ tree,
162+ searchModeOn,
163+ allNodesHidden,
164+ } )
165+ }
163166 }
164167
165168 onTagRemove = ( id , isKeyboardEvent ) => {
You can’t perform that action at this time.
0 commit comments