Placeholder not displayed for empty dropdown
See original GitHub issueI use choices in single-select mode and set placeholder: true, placeholderValue: 'a string'
. The placeholder is not displayed in UI if there are no choices. When I add choices later, the placeholder is displayed correctly.
This happens with version 7.0.0
Issue Analytics
- State:
- Created 4 years ago
- Reactions:2
- Comments:5
Top Results From Across the Web
Placeholder not displayed for empty dropdown #567 - GitHub
I use choices in single-select mode and set placeholder: true, placeholderValue: 'a string' . The placeholder is not displayed in UI if ...
Read more >How do I make a placeholder for a 'select' box? - Stack Overflow
It shows the next one by default, in this case "Durr". Once the user has selected a value, he can not deselect again...
Read more >How to Make a Placeholder for a Select Box in HTML
Answer: Use the disabled and selected Attribute. There is no attribute like input's placeholder for select box dropdown. However, you can create similar...
Read more >Dropdown box not showing blank placeholder by default
It's a required field and by default it's set to have a blank placeholder and blank default value, however when you go to...
Read more >:placeholder-shown - CSS: Cascading Style Sheets | MDN
The :placeholder-shown CSS pseudo-class represents any <input> or <textarea> element that is currently displaying placeholder text.
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I came across this problem since choices.ClearStore() also removes the placeholder item. The solution I’m using is this:
placeholderItem = choices._getTemplate( 'placeholder', 'This is a placeholder' ); choices.itemList.append(placeholderItem);
Where ‘choices’ is the name of your choices object.
Hi @jshjohnson I am having this issue now. I am fetching items with async ajax and one of the elements returned has the property selected set to true. Is there a fix or workaround for this? Thanks!
@hg64 @Colin-Moran @code-chris pinging you guys too in case you have found a proper solution for this.