Adding optgroup
elements to a "has taxonomy term (with depth)" exposed filter on a Drupal 9/10 view (for sharing on Drupal issue #2384203).
Screenshot of what the select with optgroup
looks like on our site, edited for length:
Select with optgroup
HTML:
<select data-drupal-selector="edit-unique-category-depth-filter" id="edit-unique-category-depth-filter" name="unique_category_depth_filter" class="form-select">
<option value="All" selected="selected">- Any -</option>