[mdc-select] [a11y] support typeahead
Bug report
The new mdc-select component does not support first letter navigation like the default 'select' > 'option' variant does.
Steps to reproduce
Open the a11y variant of the mdc-select component and try to navigate to a list item with the keyboard.
Actual behavior
The list items wont get selected
Expected behavior
That the list item can be selected with the keyboard by selecting the first letter
Your Environment:
| Software | Version(s) |
|---|---|
| MDC Web | 4.0.0 |
| Browser | Chrome |
| Operating System | Windows |
Thanks for the bug! We're currently working on select, so we'll add this to the features requested for it
Hi,
We've prototyped this feature in the list foundation and will keep this issue updated as to its rollout status. FYI, the currently the prescribed behavior is:
- Type a character: focus moves to the next item with a name that starts with the typed character.
- Type multiple characters in rapid succession: focus moves to the next item with a name that starts with the string of characters typed.
From https://www.w3.org/TR/wai-aria-practices/examples/listbox/listbox-collapsible.html
First letter navigation doesn't work. As reference you can see on demo page: https://material-components.github.io/material-components-web-catalog/#/component/select
The demo is on v4.0 and needs to be updated. Meanwhile you can play with the latest version (v7) here: https://codepen.io/allanchenmdc/pen/MWKEqrK
@allan-chen Thanks, it works in codepen. Btw, can you please suggest how to make it open always down (i have a long list and it opens up, v6) and if possible to limit height of the list?
Glad it works! Menusurface opens up if there's not enough space to open downwards. One way to nudge it to open down is to restrict the max-height of the mdc-select__menu element so there's more often than not space to open below. Hope this helps!