Skip to content

fix(expansion-panel): don't handle enter/space if modifier is pressed - #13790

Merged
mmalerba merged 1 commit into
angular:masterfrom
crisbeto:13783/expansion-panel-modifier-keys
Oct 25, 2018
Merged

fix(expansion-panel): don't handle enter/space if modifier is pressed#13790
mmalerba merged 1 commit into
angular:masterfrom
crisbeto:13783/expansion-panel-modifier-keys

Conversation

@crisbeto

Copy link
Copy Markdown
Member

Doesn't preventDefault and handle the enter and space key presses if the user is pressing any of the modifier keys.

Fixes#13783.

Doesn't `preventDefault` and handle the enter and space key presses if the user is pressing any of the modifier keys.
Fixesangular#13783.
@crisbetocrisbeto added the target: patch This PR is targeted for the next patch release label Oct 24, 2018
@googlebotgooglebot added the cla: yes PR author has agreed to Google's Contributor License Agreement label Oct 24, 2018

@jelbournjelbourn left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

case ENTER:
event.preventDefault();
this._toggle();
if (!event.altKey && !event.metaKey && !event.shiftKey && !event.ctrlKey) {

Copy link
Copy Markdown
Contributor

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

@jelbournjelbourn added pr: lgtm action: merge The PR is ready for merge by the caretaker labels Oct 24, 2018
@mmalerba
mmalerba merged commit 04716b1 into angular:masterOct 25, 2018
crisbeto added a commit to crisbeto/material2 that referenced this pull request Oct 26, 2018
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.
mmalerba pushed a commit that referenced this pull request Oct 26, 2018
…#13790)
Doesn't `preventDefault` and handle the enter and space key presses if the user is pressing any of the modifier keys.
Fixes#13783.
jelbourn pushed a commit that referenced this pull request Oct 29, 2018
…13827)
Along the same lines as #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.
crisbeto added a commit to crisbeto/material2 that referenced this pull request Nov 1, 2018
Based off of the conversation in angular#13790, these changes add some utilities for dealing with modifier keys on keyboard events.
crisbeto added a commit to crisbeto/material2 that referenced this pull request Nov 1, 2018
Based off of the conversation in angular#13790, these changes add some utilities for dealing with modifier keys on keyboard events.
crisbeto added a commit to crisbeto/material2 that referenced this pull request Nov 1, 2018
Based off of the conversation in angular#13790, these changes add some utilities for dealing with modifier keys on keyboard events.
crisbeto added a commit to crisbeto/material2 that referenced this pull request Nov 1, 2018
Based off of the conversation in angular#13790, these changes add some utilities for dealing with modifier keys on keyboard events.
crisbeto added a commit to crisbeto/material2 that referenced this pull request Nov 2, 2018
Based off of the conversation in angular#13790, these changes add some utilities for dealing with modifier keys on keyboard events.
crisbeto added a commit to crisbeto/material2 that referenced this pull request Nov 3, 2018
Based off of the conversation in angular#13790, these changes add some utilities for dealing with modifier keys on keyboard events.
crisbeto added a commit to crisbeto/material2 that referenced this pull request Nov 3, 2018
Based off of the conversation in angular#13790, these changes add some utilities for dealing with modifier keys on keyboard events.
crisbeto added a commit to crisbeto/material2 that referenced this pull request Nov 3, 2018
Based off of the conversation in angular#13790, these changes add some utilities for dealing with modifier keys on keyboard events.
crisbeto added a commit to crisbeto/material2 that referenced this pull request Nov 3, 2018
Based off of the conversation in angular#13790, these changes add some utilities for dealing with modifier keys on keyboard events.
crisbeto added a commit to crisbeto/material2 that referenced this pull request Nov 3, 2018
Based off of the conversation in angular#13790, these changes add some utilities for dealing with modifier keys on keyboard events.
crisbeto added a commit to crisbeto/material2 that referenced this pull request Nov 3, 2018
Based off of the conversation in angular#13790, these changes add some utilities for dealing with modifier keys on keyboard events.
crisbeto added a commit to crisbeto/material2 that referenced this pull request Nov 3, 2018
Based off of the conversation in angular#13790, these changes add some utilities for dealing with modifier keys on keyboard events.
crisbeto added a commit to crisbeto/material2 that referenced this pull request Nov 3, 2018
Based off of the conversation in angular#13790, these changes add some utilities for dealing with modifier keys on keyboard events.
crisbeto added a commit to crisbeto/material2 that referenced this pull request Nov 3, 2018
Based off of the conversation in angular#13790, these changes add some utilities for dealing with modifier keys on keyboard events.
atscott pushed a commit to atscott/components that referenced this pull request Nov 5, 2018
…angular#13790)
Doesn't `preventDefault` and handle the enter and space key presses if the user is pressing any of the modifier keys.
Fixesangular#13783.
atscott pushed a commit to atscott/components that referenced this pull request Nov 5, 2018
…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.
jelbourn pushed a commit that referenced this pull request Nov 6, 2018
…13827)
Along the same lines as #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.
vivian-hu-zz pushed a commit that referenced this pull request Nov 6, 2018
Based off of the conversation in #13790, these changes add some utilities for dealing with modifier keys on keyboard events.
vivian-hu-zz pushed a commit that referenced this pull request Nov 7, 2018
Based off of the conversation in #13790, these changes add some utilities for dealing with modifier keys on keyboard events.
josephperrott pushed a commit that referenced this pull request Nov 20, 2018
Based off of the conversation in #13790, these changes add some utilities for dealing with modifier keys on keyboard events.
@angular-automatic-lock-bot

Copy link
Copy Markdown

This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

This action has been performed automatically by a bot.

@angular-automatic-lock-botangular-automatic-lock-botBot locked and limited conversation to collaborators Sep 10, 2019
Sign up for freeto subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

action: mergeThe PR is ready for merge by the caretakercla: yesPR author has agreed to Google's Contributor License Agreementtarget: patchThis PR is targeted for the next patch release

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Do not toggle expansion panel on Enter or Space if Ctrl is pressed

5 participants

@crisbeto@jelbourn@googlebot@josephperrott@mmalerba