-
Notifications
You must be signed in to change notification settings - Fork 6.8k
mat-select should close when escape is pressed, also stop propagation #7981
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
Comments
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. Fixes angular#7981.
Closing as something that will be resolved by #8531. |
This wasn't fixed |
this is because of |
Not reproducible any more |
@alex-okrushko , It is still easily reproducible. Please look at this example: |
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. |
Bug, feature request, or proposal:
bug?
What is the expected behavior?
when mat-select is open and escape is pressed it should close the select
What is the current behavior?
select doesn't close and the element upstream gets the escape. In my case the mat-drawer catches this Escape which results in weird behavior: drawer closes, and the opened select is floating outside of it (because it's part of the cdk-portal).
What are the steps to reproduce?
http://plnkr.co/edit/vtBv4N8p0o4hzFetaOGx?p=preview
Open drawer
Click the selector
Press ESC
The text was updated successfully, but these errors were encountered: