question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Uncontrolled MultiSelect example?

See original GitHub issue

Environment

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:

multiselect

Thanks!

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:6 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
rrramani1230commented, Feb 19, 2022

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 😦

0reactions
rrramani1230commented, Feb 11, 2022

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

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found