Skip to content

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

Closed

Description

@igodorogea

Reproduction

StackBlitz to reproduce:

Steps to reproduce:

  1. Open overlay
  2. Open menu
  3. Press Escape

Expected Behavior

Only menu is closed, overlay stays open.

Actual Behavior

Overlay and menu are both closed.

Environment

  • Angular: 11.2.x - 12.0.0
  • CDK/Material: 11.2.x - 12.0.0
  • Browser(s): Chrome, Opera, FF, Edge
  • Operating System (e.g. Windows, macOS, Ubuntu): Windows

Activity

  1. added
    needs triage
    on May 13, 2021
  2. changed the title [-]bug(menu): parent overlay is closed when pressing Escape[/-] [+]bug(cdk/overlay): cdkConnectedOverlay closes on escape even when another overlay is open[/+] on May 13, 2021
  3. jelbourn commented on May 13, 2021

    @jelbourn
    Contributor

    This is specifically the behavior of the cdkConnectedOverlay directive, which always closes on escape without doing any extra checking. To work around, you could manually use the Overlay service which gives more control over the escape behavior. Alternatively, you can set disableClose on cdkConnectedOverlay and either conditionally re-enable it or manually close on escape.

  4. added
    P4
    help wanted
    and removed
    needs triage
    on May 13, 2021
  5. igodorogea commented on May 13, 2021

    @igodorogea
    Author

    @jelbourn are you sure that this is a bug in cdkConnectedOverlay?
    There is no such issue with autocomplete or datepicker.
    Both of them are somehow stopping Escape propagation.
    Shouldn't menu do the same?

  6. jelbourn commented on May 18, 2021

    @jelbourn
    Contributor

    I see- it looks like it could be fixed on either side, then.

  7. added
    P3
    and removed
    P4
    help wanted
    on Jun 1, 2021
  8. self-assigned this
    on Jun 1, 2021
  9. 1 remaining item

  10. added a commit that references this issue on Jun 1, 2021
    f56feef
  11. added 2 commits that reference this issue on Jun 7, 2021
    aeecb3c
    38aeb86
  12. added a commit that references this issue on Jun 9, 2021
    1de1954
  13. angular-automatic-lock-bot commented on Jul 8, 2021

    @angular-automatic-lock-bot

    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.

  14. locked and limited conversation to collaborators on Jul 8, 2021
  15. added a commit that references this issue on Jul 27, 2021
    d88e04f
  16. added 3 commits that reference this issue on Jul 30, 2021
    e373721
    5f529db
    28b589a
  17. added a commit that references this issue on Aug 4, 2021
    71c6a6b
  18. added 2 commits that reference this issue on Jan 15, 2022
    864b8ae
    4182717
  19. added a commit that references this issue on Apr 3, 2022
    338a09c
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

P3area: material/menu

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions