Show optgroup during search
See original GitHub issueI’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:
- Created 5 years ago
- Reactions:4
- Comments:6
Top 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 >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
Please re-open this issue.
Here’s a fiddle that highlights this, and my other two issues in one:
https://jsfiddle.net/n7yvrdzL/8/