Skip to content

fix(material/menu): not interrupting keyboard events to other overlays #22928

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

Merged
merged 1 commit into from
Jul 30, 2021

Conversation

crisbeto
Copy link
Member

@crisbeto crisbeto commented Jun 9, 2021

This is a resubmit of #22856 which had some issues in g3.

For historical reasons, mat-menu doesn't use the same keyboard event dispatcher as the other overlays. To work around it, previously we added a dummy subscription so that the menu would still show up in the overlay keyboard stack.

This works for most events, but it breaks down for the escape key, because closing the menu removes it from the stack immediately, allowing the event to bubble up to the document and be dispatched to the next overlay in the stack.

These changes resolve the issue by adding a stopPropagation call.

Fixes #22694.

@crisbeto crisbeto added P3 An issue that is relevant to core functions, but does not impede progress. Important, but not urgent merge: caretaker note Alert the caretaker performing the merge to check the PR for an out of normal action needed or note target: patch This PR is targeted for the next patch release labels Jun 9, 2021
@crisbeto crisbeto requested a review from andrewseguin June 9, 2021 05:15
@google-cla google-cla bot added the cla: yes PR author has agreed to Google's Contributor License Agreement label Jun 9, 2021
@crisbeto
Copy link
Member Author

crisbeto commented Jun 9, 2021

Caretaker note: the previous PR had to be reverted due to an issue in g3. If resolving the issue is difficult, I can try to limit the scope of these changes only to escape key presses.

@andrewseguin andrewseguin added the action: merge The PR is ready for merge by the caretaker label Jun 11, 2021
This is a resubmit of angular#22856 which had some issues in g3.

For historical reasons, `mat-menu` doesn't use the same keyboard event dispatcher as the other overlays. To work around it, previously we added a dummy subscription so that the menu would still show up in the overlay keyboard stack.

This works for most events, but it breaks down for the escape key, because closing the menu removes it from the stack immediately, allowing the event to bubble up to the document and be dispatched to the next overlay in the stack.

These changes resolve the issue by adding a stopPropagation call.

Fixes angular#22694.
@zarend zarend merged commit 5f529db into angular:master Jul 30, 2021
zarend pushed a commit that referenced this pull request Jul 30, 2021
#22928)

This is a resubmit of #22856 which had some issues in g3.

For historical reasons, `mat-menu` doesn't use the same keyboard event dispatcher as the other overlays. To work around it, previously we added a dummy subscription so that the menu would still show up in the overlay keyboard stack.

This works for most events, but it breaks down for the escape key, because closing the menu removes it from the stack immediately, allowing the event to bubble up to the document and be dispatched to the next overlay in the stack.

These changes resolve the issue by adding a stopPropagation call.

Fixes #22694.

(cherry picked from commit 5f529db)
zarend pushed a commit that referenced this pull request Jul 30, 2021
#22928)

This is a resubmit of #22856 which had some issues in g3.

For historical reasons, `mat-menu` doesn't use the same keyboard event dispatcher as the other overlays. To work around it, previously we added a dummy subscription so that the menu would still show up in the overlay keyboard stack.

This works for most events, but it breaks down for the escape key, because closing the menu removes it from the stack immediately, allowing the event to bubble up to the document and be dispatched to the next overlay in the stack.

These changes resolve the issue by adding a stopPropagation call.

Fixes #22694.

(cherry picked from commit 5f529db)
zarend added a commit to zarend/components that referenced this pull request Aug 4, 2021
zarend added a commit that referenced this pull request Aug 4, 2021
… overlays (#22928)" (#23306)

This reverts commit 5f529db.

(cherry picked from commit 50655e2)
zarend added a commit that referenced this pull request Aug 4, 2021
zarend added a commit that referenced this pull request Aug 4, 2021
… overlays (#22928)" (#23306)

This reverts commit 5f529db.

(cherry picked from commit 50655e2)
@angular-automatic-lock-bot
Copy link

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-bot angular-automatic-lock-bot bot locked and limited conversation to collaborators Aug 30, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
action: merge The PR is ready for merge by the caretaker cla: yes PR author has agreed to Google's Contributor License Agreement merge: caretaker note Alert the caretaker performing the merge to check the PR for an out of normal action needed or note P3 An issue that is relevant to core functions, but does not impede progress. Important, but not urgent target: patch This PR is targeted for the next patch release
Projects
None yet
Development

Successfully merging this pull request may close these issues.

bug(cdk/overlay): cdkConnectedOverlay closes on escape even when another overlay is open
3 participants