Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Change options_html to return
<option>
for 1-item groups
Previous versions of Choices.js happily accepted HTML like this: ```html <optgroup label=""> <option value="">All organisations</option> </optgroup> ``` However, in v11+ of Choices.js, that's no longer allowed - presumably since this change: Choices-js/Choices#615 The option is now silently dropped from rendering. Choices.js now seems to expect such HTML to be passed outside of an `<optgroup>`, i.e. `<option value="">All organisations</option>`. NB, it is perfectly fine to mix top-level `<option>`s with `<optgroup>`s: https://www.w3.org/TR/WCAG20-TECHS/H85.html#:~:text=The%20optgroup%20element%20should%20be,desired%20intent%20when%20using%20this. This work was made a bit tricky by us having separate `options` and `grouped_options` parameters, meaning we have to maintain two separate methods, making behaviour change more difficult. I had hoped to consolidate onto one single `options` parameter and have the helper be clever enough to dynamically return options or optgroups, but in my attempt in 2b643a8 there were so many test failures that this wider rearchitecture was not worth the time.
- Loading branch information