Closed oyeanuj closed 4 years ago
Hi @oyeanuj . The primary goal of this component was to mimic the behavior of the built in HTML select, that's why I wen't with that design decision. But there is ways to make this happen.
Right now you have to alternatives to add this behavior yourself.
Styling. You can simply hide the select area and display it on focus. On focus, the element gets the class has-focus
. And multi selects already have the --multiple
modifier. More on class names here https://github.com/tbleckert/react-select-search#custom-class-names . FYI, it's now possible to pass a function as the className for more control.
We've made it possible to use this headless, meaning you write your own view components using hooks. https://github.com/tbleckert/react-select-search#headless-mode-with-hooks
A third option added to v1.2. You can now set printOptions
to on-focus
. This will only render the options list if the select has focus. Other options are: auto, always, never.
Hi @tbleckert, thank you for creating this useful library!
Similar to #37 and #56 , this question also relates to closing. I'm wondering how do I make a multi-select be a dropdown and close after selection (or with an 'X'). FWIW, most libraries like
react-select
orreact-super-select
allow you to have a dropdown, select multiple and then close the dropdown.Any thoughts on how to make this happen?