Skip to content

bug(mat-menu/cdk-overlay): mat-menu items are clipped when content height grows after menu is opened. #21456

Closed

Description

@DaxChen

Reproduction

https://stackblitz.com/edit/angular-sfz2cr

Steps to reproduce:

  1. scroll the inner pink box to make the menu open downwards, but the opened menu just touches the bottom, like this: image
  2. The bug also happens on the opposite direction, when opening the menu upwards and the menu top touches the viewport top, like this: Screen Shot 2020-12-28 at 12 09 36 AM
  3. after 1 second, 20 new items will be added to the menu to make the menu longer.
  4. notice the menu is clipped and not all items are visible.

This only happens when the menu trigger is in a scrollable area.

Expected Behavior

The menu should be able to scroll and see all items.

Actual Behavior

the menu is clipped

Environment

  • Angular: 11.0.6
  • CDK/Material: 11.0.3
  • Browser(s): Version 87.0.4280.88 (Official Build) (x86_64)
  • Operating System (e.g. Windows, macOS, Ubuntu): macOS 10.15.7

Activity

  1. added
    needs triage
    on Dec 28, 2020
  2. self-assigned this
    on Dec 28, 2020
  3. added
    P3
    and removed
    needs triage
    on Dec 28, 2020
  4. added a commit that references this issue on Dec 28, 2020
    57df72f
  5. added a commit that references this issue on Feb 7, 2021
    c02a6d6
  6. added a commit that references this issue on May 3, 2021
    bcc79b0
  7. added a commit that references this issue on Jul 27, 2021
    11be78f
  8. added a commit that references this issue on Jan 3, 2022
    fb6d88f
  9. added 5 commits that reference this issue on Jan 31, 2022
    d85d950
    f119525
    2e83530
    0c8a681
    0c8bd05
  10. added 2 commits that reference this issue on Feb 1, 2022
    d7fe423
    a74d92e
  11. added a commit that references this issue on Feb 2, 2022
    26fabcd
  12. added a commit that references this issue on Feb 11, 2022
    599d1b4
  13. added 2 commits that reference this issue on Feb 15, 2022
    099e8d7
    06648fa
  14. angular-automatic-lock-bot commented on Mar 4, 2022

    @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.

  15. locked and limited conversation to collaborators on Mar 4, 2022
  16. added 2 commits that reference this issue on Apr 3, 2022
    c225824
    37f1ec0
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