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.

Show optgroup during search

See original GitHub issue

I’m using <optgroup> to group choices and it works fine. When the user starts searching, though, the optgroups aren’t rendered. This is a huge problem for me as several choices have the same name but are under a different group. Without the group names it’s impossible for the user to know what he’s selecting.

Is there any way to show the optgroups even during search? Any chance you could add this functionality otherwise?

The order of search results would need to change if this is enabled I guess because you only want to print the group names once. The order of the groups should probably also be configurable. In my case I would like to retain the order of the groups regardless of where the most relevant search result is.

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Reactions:4
  • Comments:6

github_iconTop GitHub Comments

5reactions
alanhamlettcommented, Oct 22, 2019

Please re-open this issue.

1reaction
powerbuoycommented, Mar 12, 2019

Here’s a fiddle that highlights this, and my other two issues in one:

https://jsfiddle.net/n7yvrdzL/8/

Read more comments on GitHub >

github_iconTop Results From Across the Web

Display result matching optgroup using select2 - Stack Overflow
Now I would like to know whether it is possible to display all optgroup items if the search matches the optgroup name while...
Read more >
Optgroup matcher search in v. 4.0.0 · Issue #3034 - GitHub
Currently search works halfway for optgroups IMHO: The Good: Searching for option by name shows options with matched text AND optgroup they ...
Read more >
Options | Select2 - The jQuery replacement for select boxes
Select2 is a jQuery based replacement for select boxes. It supports searching, remote data sets, and pagination (infinite scrolling) of results.
Read more >
<optgroup>: The Option Group element - MDN Web Docs
The <optgroup> HTML element creates a grouping of options within a <select> ... none of the items in this option group is selectable....
Read more >
Select2 3.5.3
You can set data- attributes to <option> (or <optgroup>) and use them inside ... In this example we will search for repositories using...
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