Skip to content
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

bug(MatSelect): When panel is displayed inside a SideNav, it stays opened on Escape button #30507

Open
1 task
rsi21 opened this issue Feb 17, 2025 · 1 comment
Labels
area: material/select area: material/sidenav P3 An issue that is relevant to core functions, but does not impede progress. Important, but not urgent

Comments

@rsi21
Copy link

rsi21 commented Feb 17, 2025

Is this a regression?

  • Yes, this behavior used to work in the previous version

The previous version in which this bug was not present was

No response

Description

Hi,

When using MatSelect inside a SideNav, if the panel is opened and we close the sideNav with the Escape button, the MatSelect panel stays opened.

I expected the same behavior like with the MatDatePicker, if the picker panel is opened, when using Escape the picker is closed first, and then using Escape again closes the sideNav.

I also provide the same sample inside a Dialog using the MatSelect and MatDatePicker and in this case, both works the same way and correctly.

The issue seems related to this one:
#7981

Thanks

Reproduction

StackBlitz link: https://stackblitz.com/edit/components-issue-starter-r9az1u4q
Steps to reproduce:

  1. Click on button to open the SideNav
  2. Open the MatSelect panel
  3. Click on Escape

Expected Behavior

MatSelect should be closed with the escape button instead of the SideNav

Actual Behavior

SideNav is closed and MatSelect panel stays visible

Environment

  • Angular: 18 (same issue in 19)
  • CDK/Material: 18 (same issue in 19)
  • Browser(s): Chrome
  • Operating System (e.g. Windows, macOS, Ubuntu): Windows
@rsi21 rsi21 added the needs triage This issue needs to be triaged by the team label Feb 17, 2025
@crisbeto crisbeto added P3 An issue that is relevant to core functions, but does not impede progress. Important, but not urgent area: material/select area: material/sidenav and removed needs triage This issue needs to be triaged by the team labels Feb 17, 2025
Veribelll added a commit to Veribelll/angular-cdk that referenced this issue Feb 19, 2025
The esc button was processed only in the overlay, which led to the container not closing in sidenav.

Fixes angular#30507
@rsi21
Copy link
Author

rsi21 commented Feb 25, 2025

Hi @crisbeto,

i see the fix from @Veribelll has been canceled because there is a plan for more important changes (logic into _handleOverlayKeydown) right ?
Is there any issue to follow that changes ? and are they planned ?

Thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: material/select area: material/sidenav P3 An issue that is relevant to core functions, but does not impede progress. Important, but not urgent
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants