Skip to content

Commit

Permalink
Use 1.18's aria role for dropdown menus (#24144) (#24155)
Browse files Browse the repository at this point in the history
Backport #24144

Co-authored-by: silverwind <me@silverwind.io>
  • Loading branch information
wxiaoguang and silverwind committed Apr 17, 2023
1 parent 463e144 commit 03b6e79
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions web_src/js/features/aria.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,8 @@ function attachOneDropdownAria($dropdown) {
// Since #19861 we have prepared the "combobox" solution, but didn't get enough time to put it into practice and test before.
const isComboBox = $dropdown.find('input').length > 0;

const focusableRole = isComboBox ? 'combobox' : 'button';
const listPopupRole = isComboBox ? 'listbox' : 'menu';
const focusableRole = isComboBox ? 'combobox' : 'menu';
const listPopupRole = isComboBox ? 'listbox' : '';
const listItemRole = isComboBox ? 'option' : 'menuitem';

// make the item has role=option/menuitem, add an id if there wasn't one yet, make items as non-focusable
Expand Down

0 comments on commit 03b6e79

Please sign in to comment.