[mdc-list]: default behavior incorrectly prevented for shortcuts with modifiers #6365
Description
Bug report
The MDC list supports keyboard interaction. e.g. pressing arrow keys or pressing
HOME or the END key. This is great, but unfortunately it looks like the keyboard
handler incorrectly picks up such keys regardless of modifiers (such as SHIFT
).
This means that native OS keyboard shortcuts might be prevented / or the list behavior
is simply unexpected. For example, consider the SHIFT + END
shortcut. Currently this
will go the end of the list, but in reality this would be unexpected as per W3C recommended
listbox shortcuts. Also it means that it will clash with screenreaders for example (e.g. JAWS)
https://defkey.com/what-means/shift-end
Steps to reproduce
- Go to https://material-components-web.appspot.com/list.html
- Click on an interactive list
- Press SHIFT + END
Actual behavior
MDC list does not check modifier keys when handling keys like HOME
or END
.
Expected behavior
MDC list would check for modifier keys so that it doesn't not accidentally prevent the
default browser/OS behavior when e.g. SHIFT + HOME
is pressed.