This repository was archived by the owner on Jan 13, 2025. It is now read-only.

Description
Bug report
MDCMenu that is positioned near the bottom edge of the screen will get cropped to a thin line rather than being repositioned above the anchor. getOriginCorner_ doesn't use MARGIN_TO_EDGE, but getMenuSurfaceMaxHeight_ does, causing the inconsistency and cropping.
Steps to reproduce
- Create a menu that opens near the bottom of the screen where it would overlap MARGIN_TO_EDGE
- Notice how the menu is cropped instead of being repositioned above the anchor
Actual behavior
The menu gets cropped because of its max-height property
Expected behavior
The menu should be aligned BOTTOM instead of TOP.
Screenshots

Your Environment:
| Software |
Version(s) |
| MDC Web |
5.0.0-canary.a1a0deb3e.0 |
| Browser |
Chrome |
| Operating System |
OSX |
Additional context
This was surfaced while using the web-components version of the MDCMenu but the error appears to be here.
Possible solution
getOriginCorner_ should take into account the MARGIN_TO_EDGE here:
|
const availableBottom = isBottomAligned ? viewportDistance.bottom - this.anchorMargin_.bottom |
and reposition the menu above.