Skip to content
This repository has been archived by the owner on Jan 13, 2025. It is now read-only.

[mdc-list]: default behavior incorrectly prevented for shortcuts with modifiers #6365

Closed
@devversion

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

  1. Go to https://material-components-web.appspot.com/list.html
  2. Click on an interactive list
  3. 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.

Metadata

Assignees

No one assigned

    Labels

    Unresolved (Archived)Open and unresolved issues and PRs that were closed due to archiving the repository.backlogbug

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions