You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Is your feature request related to a problem? Please describe.
I would like to present a search custom search input outside the tree managed by myself. Additionally i would like to programatically set the search term via props in some other situations (restoring state after application is resumed).
Describe the solution you'd like
Introduce the ability to control the search term, either in controlled tree environment or on the ref. I would have thought that controlled tree environment would be the appropriate place but I haven't used the library for long
Describe alternatives you've considered
I could hack the render search input props to render outside of the tree somehow but this feels wrong. I could also implement search myself but having a custom item and managing the state for search and highlighting myself
Additional context
None, great library BTW, I have enjoyed using it so far
The text was updated successfully, but these errors were encountered:
If you just want to control the search state from outside, you can already do that via the ref from the tree. Note that the search state lives within a tree, not a tree environment, so you need to grab the ref from the tree component, not the environment. You can set the current search value with treeRef.setSearch(), or close the search by invoking it with null.
If you would also like to not show the included search bar, you can update the renderSearchInput prop to () => null.
Alternatively you could also adjust renderSearchInput to render a portal that mounts the search input in a different location within your place, and customize how the search bar looks like from there.
Is your feature request related to a problem? Please describe.
I would like to present a search custom search input outside the tree managed by myself. Additionally i would like to programatically set the search term via props in some other situations (restoring state after application is resumed).
Describe the solution you'd like
Introduce the ability to control the search term, either in controlled tree environment or on the ref. I would have thought that controlled tree environment would be the appropriate place but I haven't used the library for long
Describe alternatives you've considered
I could hack the render search input props to render outside of the tree somehow but this feels wrong. I could also implement search myself but having a custom item and managing the state for search and highlighting myself
Additional context
None, great library BTW, I have enjoyed using it so far
The text was updated successfully, but these errors were encountered: