summaryrefslogtreecommitdiffstats
path: root/web_src
diff options
context:
space:
mode:
authorwxiaoguang <wxiaoguang@gmail.com>2023-04-16 21:58:22 +0800
committerGitHub <noreply@github.com>2023-04-16 21:58:22 +0800
commit685b0ffa1969598a7b45b41af0a5566e5a74fabc (patch)
tree116ca4e519b405d6ea6437cf7e1d97e0b464c123 /web_src
parent0e059846670190f0a2f4935fb74b2159e2d80181 (diff)
downloadgitea-685b0ffa1969598a7b45b41af0a5566e5a74fabc.tar.gz
gitea-685b0ffa1969598a7b45b41af0a5566e5a74fabc.zip
Use 1.18's aria role for dropdown menus (#24144)
According to erion's feedback, the 1.18 approach works with Safari (`role=menu` on the parent container), while the 1.19's approach doesn't work well with Safari+VoiceOver (although I tested it worked with Chrome a little better). I have tested this 1.18 approach could work for all Safari/Chrome+VoiceOver and Chrome+Talkback. Let's try to make it on try.gitea.io to see whether it helps Safari users.
Diffstat (limited to 'web_src')
-rw-r--r--web_src/js/modules/aria/dropdown.js4
1 files changed, 2 insertions, 2 deletions
diff --git a/web_src/js/modules/aria/dropdown.js b/web_src/js/modules/aria/dropdown.js
index 26c1352416..b1ff57ab85 100644
--- a/web_src/js/modules/aria/dropdown.js
+++ b/web_src/js/modules/aria/dropdown.js
@@ -148,8 +148,8 @@ function attachInit($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;
- dropdown[ariaPatchKey].focusableRole = isComboBox ? 'combobox' : 'button';
- dropdown[ariaPatchKey].listPopupRole = isComboBox ? 'listbox' : 'menu';
+ dropdown[ariaPatchKey].focusableRole = isComboBox ? 'combobox' : 'menu';
+ dropdown[ariaPatchKey].listPopupRole = isComboBox ? 'listbox' : '';
dropdown[ariaPatchKey].listItemRole = isComboBox ? 'option' : 'menuitem';
attachDomEvents($dropdown, $focusable, $menu);