Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Hiding multi selected options - react-select

Using react-select to have a select dropdown which allows async options loading and multi select. The default behavior of the library renders the selected options next to the input itself: enter image description here

But I want to show the selected options in the options list rather than in the select header. I have achieved that by passing the Custom Option component. Here is the working example:

https://codesandbox.io/s/trusting-hellman-yidqn

And now I want to remove/hide the selected options from the header. Also I want to show the placeholder back when focus is out of the input.

like image 657
Pratik Kulshreshth Avatar asked Sep 07 '26 18:09

Pratik Kulshreshth


1 Answers

If you don't want the tags to show up in the input field, you can disable that by adding the attribute controlShouldRenderValue={false} to the item.

like image 109
Nils Kähler Avatar answered Sep 12 '26 16:09

Nils Kähler