Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Search #198

Open
aslanalyiev opened this issue Apr 12, 2023 · 3 comments
Open

Search #198

aslanalyiev opened this issue Apr 12, 2023 · 3 comments
Assignees
Labels
enhancement New feature or request

Comments

@aslanalyiev
Copy link

aslanalyiev commented Apr 12, 2023

Is your feature request related to a problem? Please describe.
Sometimes it is hard to implement a search with nested folders

Describe the solution you'd like
It would be cool to implement a search option from the box

@aslanalyiev aslanalyiev added the enhancement New feature or request label Apr 12, 2023
@minop1205
Copy link
Owner

@aslanalyiev I'm not sure what the UI image is for filtering a tree view by search, do you have a specific image?

Or do you have any references?

@aslanalyiev
Copy link
Author

aslanalyiev commented Apr 13, 2023

I meant to provide a prop where a user can put a string and TreeComponent will automatically filter data(nested as well)

const treeDataWithALotOfNestedChildren = [....];

const searchText = 'name of some element from the tree data'; //some string that a user provided to find needed the tree elements

<Tree
   tree={treeDataWithALotOfNestedChildren}
   ...requiredProps
   searchQuery={searchText}
/>

result:

New filtered tree with the preservation of the structure(e.g. if a deeply nested child has a lot of parents that don't meet searchText they also should be rendered).

initialTree:

titleR
  title2
     title3
titleR2

searchText = title3

result:

titleR
  title2
     title3

smth like that :)

@1pone
Copy link

1pone commented May 7, 2024

any update👀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants