-
Notifications
You must be signed in to change notification settings - Fork 1.9k
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
MultiSelect - clear selected items from button outside of component #2623
Comments
Hi @zerostatic! 👋 This is definitely a great question. The way it currently stands, there isn't a direct way to do this without invalidating the whole sub-tree and forcing a fresh render of everything. In the future, we can probably surface Downshift's action props to help with clearing selection/items/etc. |
I think the bigger picture here is that MultiSelect should be fully controlled, and this should probably be linked to #924 , this is a huge limitation when you're used to work with controlled components. Meanwhile, to clear only, we came up with this client javascript ugly solution, this is really not ideal and doesn't allow setting values, but works for clearing the MultiSelect: |
We've marked this issue as stale because there hasn't been any activity for a couple of weeks. If there's no further activity on this issue in the next three days then we'll close it. Thanks for your contributions. |
Hi there! 👋 If you're wondering why this issue was moved, we're currently updating our repo structure so that every package is found in the same project. This should not have any impact for you, but we wanted to give you a heads up in case you were wondering what is going on. If you have any questions, feel free to reach out to us on Slack or contact us at: [email protected]. Thanks! |
We've marked this issue as stale because there hasn't been any activity for a couple of weeks. If there's no further activity on this issue in the next three days then we'll close it. You can keep the conversation going with just a short comment. Thanks for your contributions. |
As there's been no activity since this issue was marked as stale, we are auto-closing it. |
Hi All, |
Detailed description
Is there a way to clear selected items from an action outside of the component?
Use case is this: I have multiple MultiSelect components on the screen and I have one button that when clicked, clears all selected items in the MultiSelect components so none are selected. It this possible? Or could some kind of prop be added like: clearAllSelectedItems ?
Generel question
MultiSelect
The text was updated successfully, but these errors were encountered: