Uncontrolled MultiSelect example?
See original GitHub issueEnvironment
- Package version(s):
- “@blueprintjs/core”: “^3.8.0”,
- “@blueprintjs/icons”: “^3.6.0”,
- “@blueprintjs/select”: “^3.7.0”,
- Browser and OS versions: OSX 10.14.3, Chrome 73.0.3683.75
Question
Hi!
I’m trying to get an uncontrolled MultiSelect working, but haven’t had much luck. Is there an example of one somewhere?
Here’s what I’ve got. Am I missing something obvious? Is specifying the onClick
and active
in the MenuItem
even necessary?
<MultiSelect
items={["A", "B", "C"]}
itemRenderer={(item, { modifiers, handleClick }) =>
<MenuItem
key={item}
text={item}
onClick={handleClick}
active={modifiers.active}
/>
}
onItemSelect={() => {}}
tagRenderer={item => item}
/>
This is what renders:
Thanks!
Issue Analytics
- State:
- Created 5 years ago
- Comments:6 (3 by maintainers)
Top Results From Across the Web
Multiselect | React Widgets
The <Multiselect> renders an array of data and manages the selection, filtering and ... Use defaultOpen to set an initial value for uncontrolled...
Read more >Bootstrap-multiselect: default value and onChange not working
This answer is using vanilla-js(without Bootstrap-multiselect) but should work ... I have modified your code to have multi select option.
Read more >MultiSelect - Mantine
MultiSelect component allows user to pick any amount of option from the given data : Which countries did you visit last year?
Read more >Multi Select - Clay
Multi select is the field type that allows writing text to create “tags” that are represented ... string, Property to set the default...
Read more >Select - Examples - Components - Atlassian Design System
Related options can be grouped together in both a single and multi select. What city do you live in? Choose a city ......
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
The answer to this is that you need the selectedItems prop along with the tagRender prop for it to Render. Please don’t spent as much time on this as I did finding this out 😦
Did anyone get this to work. I wonder why the MultiSelect looks like a singleselect. Are there certain props that are not required but needed for the mutliselect to work @zachkirsch @adidahiya