-
Notifications
You must be signed in to change notification settings - Fork 268
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
The searchTerm in the searchPredicate function is never an empty string #637
Comments
Is an empty string a valid search term? What use case do you anticipate for this? I made a specific change that was accepted a few months ago to do this because there did not appear to be a good reason to incur the search predicate cost across a potentially large number of nodes with an empty string. See #580 |
In my project, we use the searchPredicate function to build a custom async tree dropdown. Now our component is not working as expected when the input is cleared, we should be able to show all the options in that case but we can't. |
So the change I had made would not filter anything if search mode was off, which it was if the query was an empty string. That is, I would expect the default behavior with an empty string is to show all options. Is this something you can create a code sandbox demonstrating? |
Hi, I have a sandbox here with an example: https://codesandbox.io/s/blue-snowflake-jqt35v?file=/src/index.js if the search term is empty, it is not reflected that way in the searchPredicate |
I like the idea of a separate function to notify when the search input is empty but I wonder why there are so many changed files. We need to verify if every snapshot is still the same, which at a glance appears to be so but again, I don't like the fact that avajs decided to change the render sequence throwing the git diff off. |
Thanks for your response @mrchief. The many file changes are indeed related to the avajs. I only executed |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed in 10 days if no further activity occurs. Thank you for your contributions. |
Describe the bug
When a user types in the input field, the searchPredicate function is triggered with whatever the user is writing. However, when the user empties his input field, the searchPredicate function is never triggered with an empty string.
To Reproduce
Expected behavior
When the input field is emptied, the searchPredicate function is triggered with an empty string.
The text was updated successfully, but these errors were encountered: