-
Notifications
You must be signed in to change notification settings - Fork 6.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ListKeyManager.onKeydown blocks navigation with Alt+Left #13496
Labels
Accessibility
This issue is related to accessibility (a11y)
P3
An issue that is relevant to core functions, but does not impede progress. Important, but not urgent
Comments
crisbeto
added a commit
to crisbeto/material2
that referenced
this issue
Oct 9, 2018
* Skips handling arrow key events that have a modifier key. Previously we would prevent the default action which can get in the way of some of the native keyboard shortcuts (e.g. marking all of the text using shift + up arrow). This has come up before in angular#11987, however these changes expand it to the key manager. * Adds an API that allows consumers to opt into having the key manager handle some modifier keys. This is an exception for some of our components where we have custom functionality for shift + arrow key. * Fixes the `metaKey` always being set to true on our fake keyboard events. Fixes angular#13496.
crisbeto
added
P3
An issue that is relevant to core functions, but does not impede progress. Important, but not urgent
Accessibility
This issue is related to accessibility (a11y)
has pr
labels
Oct 9, 2018
crisbeto
added a commit
to crisbeto/material2
that referenced
this issue
Oct 9, 2018
* Skips handling arrow key events that have a modifier key. Previously we would prevent the default action which can get in the way of some of the native keyboard shortcuts (e.g. marking all of the text using shift + up arrow). This has come up before in angular#11987, however these changes expand it to the key manager. * Adds an API that allows consumers to opt into having the key manager handle some modifier keys. This is an exception for some of our components where we have custom functionality for shift + arrow key. * Fixes the `metaKey` always being set to true on our fake keyboard events. Fixes angular#13496.
crisbeto
added a commit
to crisbeto/material2
that referenced
this issue
Oct 9, 2018
* Skips handling arrow key events that have a modifier key. Previously we would prevent the default action which can get in the way of some of the native keyboard shortcuts (e.g. marking all of the text using shift + up arrow). This has come up before in angular#11987, however these changes expand it to the key manager. * Adds an API that allows consumers to opt into having the key manager handle some modifier keys. This is an exception for some of our components where we have custom functionality for shift + arrow key. * Fixes the `metaKey` always being set to true on our fake keyboard events. Fixes angular#13496.
crisbeto
added a commit
to crisbeto/material2
that referenced
this issue
Nov 8, 2018
* Skips handling arrow key events that have a modifier key. Previously we would prevent the default action which can get in the way of some of the native keyboard shortcuts (e.g. marking all of the text using shift + up arrow). This has come up before in angular#11987, however these changes expand it to the key manager. * Adds an API that allows consumers to opt into having the key manager handle some modifier keys. This is an exception for some of our components where we have custom functionality for shift + arrow key. * Fixes the `metaKey` always being set to true on our fake keyboard events. Fixes angular#13496.
vivian-hu-zz
pushed a commit
that referenced
this issue
Nov 8, 2018
…#13503) * Skips handling arrow key events that have a modifier key. Previously we would prevent the default action which can get in the way of some of the native keyboard shortcuts (e.g. marking all of the text using shift + up arrow). This has come up before in #11987, however these changes expand it to the key manager. * Adds an API that allows consumers to opt into having the key manager handle some modifier keys. This is an exception for some of our components where we have custom functionality for shift + arrow key. * Fixes the `metaKey` always being set to true on our fake keyboard events. Fixes #13496.
vivian-hu-zz
pushed a commit
that referenced
this issue
Nov 12, 2018
…#13503) * Skips handling arrow key events that have a modifier key. Previously we would prevent the default action which can get in the way of some of the native keyboard shortcuts (e.g. marking all of the text using shift + up arrow). This has come up before in #11987, however these changes expand it to the key manager. * Adds an API that allows consumers to opt into having the key manager handle some modifier keys. This is an exception for some of our components where we have custom functionality for shift + arrow key. * Fixes the `metaKey` always being set to true on our fake keyboard events. Fixes #13496.
This issue has been automatically locked due to inactivity. Read more about our automatic conversation locking policy. This action has been performed automatically by a bot. |
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Labels
Accessibility
This issue is related to accessibility (a11y)
P3
An issue that is relevant to core functions, but does not impede progress. Important, but not urgent
Bug, feature request, or proposal:
When using a component that uses
ListKeyManager
under the hood, especially<mat-tab-header />
, theonKeydown
event handler swallows Alt+←, preventing the browser from going back. The same issue occurs with Alt+→, swallowing attempts to navigate forward, and it may possibly interfere with other events as well.What is the expected behavior?
It should be possible to use keyboard shortcuts like Alt+← and Alt+→ when the tab bar is focused.
What is the current behavior?
Shortcuts like Alt+← and Alt+→ are treated as navigations within the component, calling
event.preventDefault();
and thus interfering with the navigation attempt.What are the steps to reproduce?
Stackblitz Demo
<mat-tab-group />
component.What is the use-case or motivation for changing an existing behavior?
In some circumstances, the tab bar can become inadvertently focused without even clicking the tab bar, such as during a navigation event. This can interfere with a user's ability to navigate by keyboard, at least degrading the experience, requiring the user to blur the tab group before they are able to navigate.
Which versions of Angular, Material, OS, TypeScript, browsers are affected?
This issue does not impact a specific browser, OS, or TypeScript version.
Is there anything else we should know?
I can make a PR for fixing this, but exactly how to fix it should be agreed upon first. One potential solution would be to return early out of the
onKeydown
handler when any modifier is being held.The text was updated successfully, but these errors were encountered: