Comments (7)
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
from react-dropdown-tree-select.
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.
from react-dropdown-tree-select.
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?
from react-dropdown-tree-select.
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
from react-dropdown-tree-select.
searchPredicate
was meant to return matches, so an empty string doesn't mean it matches all. That can be a business interpretation for a particular use case but baking that in, makes the control opinionated.
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.
from react-dropdown-tree-select.
Thanks for your response @mrchief. The many file changes are indeed related to the avajs. I only executed ava --update-snapshots
so no idea what went wrong on that regard.
from react-dropdown-tree-select.
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.
from react-dropdown-tree-select.
Related Issues (20)
- By default the last child is focused and checked HOT 2
- SetState is not working on react-dropdown-tree-select HOT 2
- Issue when click item in long scrollable list HOT 3
- react-dropdown-tree-select - Get all selected values HOT 3
- Render calls reset the search filter on the list HOT 13
- ADA incompatibility HOT 1
- useState is not getting updated HOT 1
- I'm having the same problem where useState isn't working and if I use it, the checkbox values disappear. HOT 1
- Clicking on label for radioSelect doesn't select a node HOT 2
- Nodes expanded state are not updated when search HOT 1
- Close the selection menu HOT 1
- How can I remove the tags that appear when a node is selected in the dropdown? HOT 2
- Parent node displayed as checked despite receiving checked: false
- custom renderer for label HOT 1
- Dealing with too many pills HOT 2
- Add `classNamePrefix` prop to avoid class name collisions HOT 1
- for parent child dropdown, support for custom selection logic HOT 1
- The disabled item is affected by parent HOT 1
- Again full tree gets drawn after selecting a node in search mode HOT 1
- How to show parentname-nodename instead of showing only label. HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from react-dropdown-tree-select.