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

MultiSelect - clear selected items from button outside of component #2623

Closed
okstaticzero opened this issue Jul 25, 2018 · 7 comments
Closed
Labels

Comments

@okstaticzero
Copy link
Contributor

Detailed description

Is there a way to clear selected items from an action outside of the component?

Describe in detail the issue you're having.

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 ?

Is this a feature request (new component, new icon), a bug, or a general issue?

Generel question

Is this issue related to a specific component?

MultiSelect

@joshblack
Copy link
Contributor

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.

@gdelory
Copy link

gdelory commented Jan 9, 2019

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:
https://codesandbox.io/s/qvy80zqkkq
If that can help someone until MultiSelect can finally be fully controlled.

@stale
Copy link

stale bot commented May 1, 2019

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.

@carbon-bot carbon-bot transferred this issue from carbon-design-system/carbon-components-react May 9, 2019
@carbon-bot
Copy link
Contributor

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!

@stale
Copy link

stale bot commented Jun 8, 2019

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.

@stale stale bot added the status: inactive Will close if there's no further activity within a given time label Jun 8, 2019
@stale
Copy link

stale bot commented Jun 11, 2019

As there's been no activity since this issue was marked as stale, we are auto-closing it.

@nithinbabusage
Copy link

Hi All,
@cal-smith @carbon-bot @joshblack @slaytanic
Is there an option to add button Icon inside the Error message of the Multiselect carbon component means after the Medium-warning
Message below the Message add the Refresh or Home icon for example is there a way in the carbon component not much example found in the google

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Archived in project
Development

No branches or pull requests

5 participants