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.

Persist placeholder for multi-select with current values

See original GitHub issue

Currently, if you have the selector set to multi={true} and your selector has current values, the input associated with the selector will no longer have a placeholder value. This functionality makes sense and is appropriate for the vast majority of use cases, however, I was wondering if it was possible to persist the placeholder even when values exist in the multi-select.

Here is my use case:

I want to turn this selector, which currently has 2 values and with autosize={false}: (notice the blank space under the tags is where the input field is)

image

into this:

image

If it’s not possible in the current implementation, I would imagine adding an attribute called persistMultiPlaceholder that would be defaulted to false. I would certainly be willing to try my hand at the addition if it’s something that fits with the path of react-select.

Thanks! 😃

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Reactions:25
  • Comments:7 (1 by maintainers)

github_iconTop GitHub Comments

1reaction
Rall3ncommented, Jun 4, 2019

react-select v1.x did not have the possibility to keep the placeholder or manage the display of components on your own. You have to use an external label/placeholder for that.

react-select v2^ gave us the possibility to customize each and every component the Select component uses with the “Components Framework”. A functioning example for this specific use-case (keeping the placeholder) can be found here.

1reaction
mslavcommented, Jun 26, 2017

Bump

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to change the placeholder property of this multiple select ...
I think you are trying to show the selected option as button title, if so this code should work for you. <select multiple...
Read more >
Select | Element Plus
Set multiple attribute for el-select to enable multiple mode. In this case, the value of v-model will be an array of selected options....
Read more >
MultiSelect - PrimeNG - PrimeFaces
MultiSelect is used to multiple values from a list of options. ... 0" class="country-placeholder"> Select Countries </div> </ng-template> <ng-template ...
Read more >
Angular MultiSelect API component - Syncfusion
The MultiSelect allows the user to pick a values from the predefined list of values. <ejs-multiselect></ejs-multiselect> ...
Read more >
Bootstrap Multiselect - free examples, templates & tutorial
Use placeholder option to set placeholder for select input. The placeholder will be displayed when input is focused and no option is selected....
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