-
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
fix(expansion-panel): don't handle enter/space if modifier is pressed #13790
fix(expansion-panel): don't handle enter/space if modifier is pressed #13790
Conversation
Doesn't `preventDefault` and handle the enter and space key presses if the user is pressing any of the modifier keys. Fixes angular#13783.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
@@ -140,8 +140,11 @@ export class MatExpansionPanelHeader implements OnDestroy, FocusableOption { | |||
// Toggle for space and enter keys. | |||
case SPACE: | |||
case ENTER: | |||
event.preventDefault(); | |||
this._toggle(); | |||
if (!event.altKey && !event.metaKey && !event.shiftKey && !event.ctrlKey) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not in this PR, but we should think about adding some helper functions to cdk/keycodes for checking stuff like this
Along the same lines as angular#13790. Doesn't handle the prevent the default action for ENTER and SPACE when one of the modifier keys is pressed, in order to avoid interefering with the native keyboard shortcuts.
Based off of the conversation in angular#13790, these changes add some utilities for dealing with modifier keys on keyboard events.
Based off of the conversation in angular#13790, these changes add some utilities for dealing with modifier keys on keyboard events.
Based off of the conversation in angular#13790, these changes add some utilities for dealing with modifier keys on keyboard events.
Based off of the conversation in angular#13790, these changes add some utilities for dealing with modifier keys on keyboard events.
Based off of the conversation in angular#13790, these changes add some utilities for dealing with modifier keys on keyboard events.
Based off of the conversation in angular#13790, these changes add some utilities for dealing with modifier keys on keyboard events.
Based off of the conversation in angular#13790, these changes add some utilities for dealing with modifier keys on keyboard events.
Based off of the conversation in angular#13790, these changes add some utilities for dealing with modifier keys on keyboard events.
Based off of the conversation in angular#13790, these changes add some utilities for dealing with modifier keys on keyboard events.
Based off of the conversation in angular#13790, these changes add some utilities for dealing with modifier keys on keyboard events.
Based off of the conversation in angular#13790, these changes add some utilities for dealing with modifier keys on keyboard events.
Based off of the conversation in angular#13790, these changes add some utilities for dealing with modifier keys on keyboard events.
Based off of the conversation in angular#13790, these changes add some utilities for dealing with modifier keys on keyboard events.
Based off of the conversation in angular#13790, these changes add some utilities for dealing with modifier keys on keyboard events.
…angular#13790) Doesn't `preventDefault` and handle the enter and space key presses if the user is pressing any of the modifier keys. Fixes angular#13783.
…ngular#13827) Along the same lines as angular#13790. Doesn't handle the prevent the default action for ENTER and SPACE when one of the modifier keys is pressed, in order to avoid interefering with the native keyboard shortcuts.
Based off of the conversation in #13790, these changes add some utilities for dealing with modifier keys on keyboard events.
Based off of the conversation in #13790, these changes add some utilities for dealing with modifier keys on keyboard events.
Based off of the conversation in #13790, these changes add some utilities for dealing with modifier keys on keyboard events.
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. |
Doesn't
preventDefault
and handle the enter and space key presses if the user is pressing any of the modifier keys.Fixes #13783.