multiselect-react-dropdown
multiselect-react-dropdown copied to clipboard
Not able to select the same option multiple times
I am trying to use this to select the same item more than once but it is preventing me from doing that.
Please explain clearly.
- Single select or multi select?
- Scenario
I have 2 students that have the same name and i do want to see both of their name in the option list. Please review and let me know.
I am getting the same issue, is there any solutions to achieve this scenario?
I found a small workaround: you need to add some zero-width space characters (ZWSP) "" to each line displayed in the dropdown. Example:
let titles = items.map((item, index) => item.title + "".repeat(index));
ZWSP does not affect the displayed text and at the same time adds uniqueness to it (because each string has it own ZWSP quantity in it).
@srigar Any plan to support this? Otherwise, I might help with a PR.
I found a small workaround: you need to add some zero-width space characters (ZWSP) "" to each line displayed in the dropdown. Example:
let titles = items.map((item, index) => item.title + "".repeat(index));
ZWSP does not affect the displayed text and at the same time adds uniqueness to it (because each string has it own ZWSP quantity in it).
I realised this approach leads to the values being selected and shown as chips but not checked within the options list. The reason is that the comparison for checkbox doesn't trim the zero-width space characters.