Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

docs-bug(cdk/menu): menu items overflow outside the menu as it exits the viewport when scrolling #30077

Closed
Salah-M opened this issue Nov 25, 2024 · 1 comment · Fixed by #30086
Assignees
Labels
area: cdk/menu P3 An issue that is relevant to core functions, but does not impede progress. Important, but not urgent

Comments

@Salah-M
Copy link

Salah-M commented Nov 25, 2024

Documentation Feedback

The examples in the CDK Menu docs are broken because the menu shrinks as it leaves the viewport while scrolling, causing the menu items to overflow.

Image

Steps to reproduce:

  1. Open CDK Menu from the angular cdk menu examples docs page.
  2. Scroll until the menu is out of the screen.

This happens in all positions of the menu but it is noticeable when the menu opens above the trigger (see attached gif)

Is the intended behavior to shrink the menu or is it supposed to leave the screen?

  1. If it is meant to shrink, then we would need to add overflow: auto to the menu's CSS so that the items don't overflow outside of it.
  2. If the menu should leave the screen, we need to prevent the height from changing, which can be fixed by adding withFlexibleDimensions(false) to the overlay’s position strategy.

Affected documentation page

https://material.angular.io/cdk/menu/examples

@Salah-M Salah-M added docs This issue is related to documentation needs triage This issue needs to be triaged by the team labels Nov 25, 2024
@crisbeto crisbeto self-assigned this Nov 26, 2024
@crisbeto crisbeto added P3 An issue that is relevant to core functions, but does not impede progress. Important, but not urgent area: cdk/menu and removed docs This issue is related to documentation needs triage This issue needs to be triaged by the team labels Nov 26, 2024
crisbeto added a commit to crisbeto/material2 that referenced this issue Nov 26, 2024
Disables flexible dimensions for the CDK menu since supporting them properly requires some CSS tweaks and we don't control the CSS of the menu.

Fixes angular#30077.
crisbeto added a commit that referenced this issue Nov 27, 2024
Disables flexible dimensions for the CDK menu since supporting them properly requires some CSS tweaks and we don't control the CSS of the menu.

Fixes #30077.

(cherry picked from commit 85d2639)
@angular-automatic-lock-bot
Copy link

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.

@angular-automatic-lock-bot angular-automatic-lock-bot bot locked and limited conversation to collaborators Dec 28, 2024
# for free to subscribe to this conversation on GitHub. Already have an account? #.
Labels
area: cdk/menu 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