components icon indicating copy to clipboard operation
components copied to clipboard

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

Open rsi21 opened this issue 11 months ago • 2 comments

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: https://github.com/angular/components/issues/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 avatar Feb 17 '25 14:02 rsi21

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

rsi21 avatar Feb 25 '25 17:02 rsi21

Hi all,

no news on the issue finally ? or need to follow a linked issue may be ?

Thks

rsi21 avatar May 13 '25 16:05 rsi21

Hi,

In case it helps, i updated the stackblitz project to Angular 20 (in case new re-work was done) https://stackblitz.com/edit/components-issue-starter-11ffwe9v?file=package.json

Hope it helps

thks

rsi21 avatar Jul 16 '25 08:07 rsi21