With isMulti, not defining a "value" for options allows to pick a first item but not another one
Hi, I'd like to report a bug.
https://codesandbox.io/s/mystifying-water-brynv
Despite my options not having a "value" key I can still browse the options and select a first item. Once I did that though, I can't see options for picking a second item. I get the "no options" UI.
I am aware that my code is broken since I should define a value for options but the fact that it's working for the first item selection feels odd.
Best
Hello @htulipe,
this is because when the component tries to get a value representation from the option, it gets undefined (default is option.value). Therefore all of your options have the same value and are excluded from the list (because they seem to be selected).
Setting the prop hideSelectedOptions to the value false (its true by default) will show that all options are highlighted as being selected.
Thanks for a quick answer @Rall3n! It makes sense. Not sure if it's a bug per se then. Shall I close ?
To anyone facing this issue, you can actually map any option field to value with getOptionValue which solves the issue without changing hideSelectedOptions.