You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
$item.find('a').attr('tabindex','-1');// as above, the elements inside the dropdown menu item should not be focusable, the focus should always be on the dropdown primary element.
14
-
}
15
-
16
-
// when the dropdown menu items are loaded from AJAX requests, the items are created dynamically
// * with search input: the input is focused, and it works perfectly with aria-activedescendant pointing another sibling element.
13
+
// Dropdown has 2 different focusing behaviors
14
+
// * with search input: the input is focused, and it works with aria-activedescendant pointing another sibling element.
42
15
// * without search input (but the readonly text), the dropdown itself is focused. then the aria-activedescendant points to the element inside dropdown
16
+
// Some desktop screen readers may change the focus, but dropdown requires that the focus must be on its primary element, then they don't work well.
43
17
44
-
// expected user interactions for dropdown with aria support:
18
+
// Expected user interactions for dropdown with aria support:
45
19
// * user can use Tab to focus in the dropdown, then the dropdown menu (list) will be shown
46
20
// * user presses Tab on the focused dropdown to move focus to next sibling focusable element (but not the menu item)
47
21
// * user can use arrow key Up/Down to navigate between menu items
48
22
// * when user presses Enter:
49
23
// - if the menu item is clickable (eg: <a>), then trigger the click event
50
24
// - otherwise, the dropdown control (low-level code) handles the Enter event, hides the dropdown menu
51
25
52
-
// TODO: multiple selection is not supported yet.
53
-
// TODO: use combobox for dropdown with search input in the future
$item.find('a').attr('tabindex','-1');// as above, the elements inside the dropdown menu item should not be focusable, the focus should always be on the dropdown primary element.
0 commit comments