Improve a11y document and dropdown item (#29753)

Co-authored-by: silverwind <me@silverwind.io>

(cherry picked from commit e01b0014de5b732181ac42c03a77c21219f88c6a)
This commit is contained in:
wxiaoguang 2024-03-13 21:44:46 +08:00 committed by Gergely Nagy
parent f99cf911e8
commit 1d4bf7e211
No known key found for this signature in database
2 changed files with 6 additions and 6 deletions

View file

@ -38,7 +38,7 @@ function updateMenuItem(dropdown, item) {
if (!item.id) item.id = generateAriaId();
item.setAttribute('role', dropdown[ariaPatchKey].listItemRole);
item.setAttribute('tabindex', '-1');
for (const a of item.querySelectorAll('a')) a.setAttribute('tabindex', '-1');
for (const el of item.querySelectorAll('a, input, button')) el.setAttribute('tabindex', '-1');
}
// make the label item and its "delete icon" has correct aria attributes