Skip to content

fix(select): closing parent overlay when pressing escape - #8060

Closed
crisbeto wants to merge 1 commit into
angular:masterfrom
crisbeto:7981/select-parent-overlay
Closed

fix(select): closing parent overlay when pressing escape#8060
crisbeto wants to merge 1 commit into
angular:masterfrom
crisbeto:7981/select-parent-overlay

Conversation

@crisbeto

Copy link
Copy Markdown
Member

After the switch to ActiveDescendantKeyManager, the select was no longer handling the escape key functionality internally, but was delegating to the underlying overlay. Since the overlay listens to keyboard events on the document, it means that escape key presses will close any parent overlays along the way. These changes add the escape listener to the select itself and stop the event propagation.

Note: the overlay directive listener should be scoped to the overlay itself, but it's better if we defer refactoring it until #6682 gets in.

Fixes#7981.

After the switch to `ActiveDescendantKeyManager`, the select was no longer handling the escape key functionality internally, but was delegating to the underlying overlay. Since the overlay listens to keyboard events on the document, it means that escape key presses will close any parent overlays along the way. These changes add the escape listener to the select itself and stop the event propagation.
**Note:** the overlay directive listener should be scoped to the overlay itself, but it's better if we defer refactoring it until angular#6682 gets in.
Fixesangular#7981.
@crisbetocrisbeto added Accessibility This issue is related to accessibility (a11y) pr: needs review labels Oct 26, 2017
@crisbeto
crisbeto requested a review from kara as a code ownerOctober 26, 2017 21:07
@googlebotgooglebot added the cla: yes PR author has agreed to Google's Contributor License Agreement label Oct 26, 2017
@willshowell

Copy link
Copy Markdown
Contributor

@crisbeto fyi #6682 is merged, in case you want to try your other solution before review

@crisbeto

Copy link
Copy Markdown
MemberAuthor

Closing in favor of #8531.

@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 7, 2019
Sign up for freeto subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

AccessibilityThis issue is related to accessibility (a11y)cla: yesPR author has agreed to Google's Contributor License Agreement

Projects

None yet

Development

Successfully merging this pull request may close these issues.

mat-select should close when escape is pressed, also stop propagation

4 participants

@crisbeto@willshowell@googlebot@andrewseguin