Closed
Description
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.
Steps to reproduce:
- Open CDK Menu from the angular cdk menu examples docs page.
- 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?
- 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. - 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.