Skip to content

Expand Tree Node when there is a match on the children of the Node #3

@Marcoga

Description

@Marcoga

First of all: Awesome work on the Component! Thanks!!

I want to show trees with deep hierarchies, which is why I want to set the treeDefaultExpandAll initially to false. However when I perform a search, and there are matches I would like to show the tree expanded. Is there a way to do this?

My first intuition was to set the treeDefaultExpandAll to true while doing a search:

 <TreeSelect
    treeDefaultExpandAll={this.state.expandAll}
    onSearch={(val) => {
     this.setState({expandAll: (val && val !== '')})
    }}>
    ...
/>

But my aproach does not work, the tree does not expand while typing. Is there a way to do this. I would also be willing to help out in any way.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions