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.

Placeholder option is not working with optgroup

See original GitHub issue

The placeholder item is not visible when used together with optgroup. (Tested with version 3.0.2)

This isn’t working (Select Value is not visible in the dropdown)

<select>
  <option value placeholder>Select Value</option>
  <optgroup label="Group 1">
    <option value="1">One</option>
    <option value="2">Two</option>
  </optgroup>
  <optgroup label="Group 2">
    <option value="3">Three</option>
    <option value="4">Four</option>
  </optgroup>
</select>

Here is a fiddle reproducing the bug.

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Reactions:3
  • Comments:8

github_iconTop GitHub Comments

3reactions
jshjohnsoncommented, Aug 14, 2017

Hey - looks like this is more just an issue of having a combination of standalone options alongside option groups. Looks like standalone options are ignored when the Choices detects groups.

Let me investigate.

1reaction
kblizeckcommented, Mar 13, 2018

@jshjohnson Any word on this? I’m trying to do the same thing, with a placeholder value that isn’t appearing ahead of <optgroup>

Read more comments on GitHub >

github_iconTop Results From Across the Web

Placeholder option is not working with optgroup #224 - GitHub
I am having this bug right now, i use optgroup and when i use a place holder in the select or directly in...
Read more >
Applying css for the disabled option when optgroup not present
The option that is hidden disabled, I would like to change the color to mimic the placeholder. How can this be done? <select...
Read more >
Grouped Material Select with Placeholder Option - MDBootstrap
It looks like I can't use a placeholder option with the optgroup grouped select? Can I do something like this: <select id=application-connection ...
Read more >
Placeholder for required <select>s - CodePen
The <select> 's first <option> has value="" , and is not inside an <optgroup> . If you want the <select> to look empty...
Read more >
optgroup issue | Roll20: Online virtual tabletop
So I've been trying to clean up one of my dropdowns by using optgroup. However, though it previews just fine, when I go...
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