Skip to content

Commit

Permalink
MDL-76246 output: combobox support improvements
Browse files Browse the repository at this point in the history
 - It was a mistake to assume the listbox is always within
   combobox.parentElement
 - Take into account that the popup of the combobox is not necessarily a
   listbox
 - Update combobox fix so that it also work with comboboxes that are not
   select-menu
 - Update combobox fix so that it also support editable comboboxes
 - Update click listener to take into account that the event's target
   might be one of the option element
 - Having a hidden input element for comboboxes was not an ARIA
   requirement and was added by us. I added data-input-element to the
   combobox element to specify the input element related to it.
  • Loading branch information
rezaies committed Mar 22, 2023
1 parent 7758724 commit c4f33ce
Show file tree
Hide file tree
Showing 4 changed files with 76 additions and 46 deletions.
3 changes: 2 additions & 1 deletion lib/templates/select_menu.mustache
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,7 @@
aria-haspopup="listbox"
aria-expanded="false"
aria-controls="{{baseid}}-listbox"
data-input-element="{{baseid}}-input"
tabindex="0"
>
{{selectedoption}}
Expand All @@ -121,7 +122,7 @@
{{/isgroup}}
{{/options}}
</ul>
<input type="hidden" name="{{name}}" value="{{value}}" />
<input type="hidden" name="{{name}}" value="{{value}}" id="{{baseid}}-input" />
</div>
{{#js}}
var label = document.getElementById('{{baseid}}-label');
Expand Down
2 changes: 1 addition & 1 deletion theme/boost/amd/build/aria.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit c4f33ce

Please sign in to comment.