Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

bug(cdkMenu): changing cdkMenuPosition during runtime is not updating the position correctly #30145

Open
1 task
michaelbe812 opened this issue Dec 7, 2024 · 0 comments · May be fixed by #30234
Open
1 task
Assignees
Labels
area: cdk/menu P3 An issue that is relevant to core functions, but does not impede progress. Important, but not urgent

Comments

@michaelbe812
Copy link

Is this a regression?

  • Yes, this behavior used to work in the previous version

The previous version in which this bug was not present was

No response

Description

if it is a user-issue/skill-issue on my side, excuse me to waste your time 😅

Reproduction

StackBlitz link: https://stackblitz.com/edit/stackblitz-starters-6rd4gzr4?description=An%20angular-cli%20project%20based%20on%20@angular/animations,%20@angular/common,%20@angular/compiler,%20@angular/core,%20@angular/forms,%20@angular/platform-browser,%20@angular/platform-browser-dynamic,%20@angular/router,%20core-js,%20rxjs,%20tslib%20and%20zone.js&file=src%2Fmain.ts&file=src%2Fglobal_styles.css&template=node&title=Angular%20Starter
Steps to reproduce:
Click the button in the first container to open a cdkMenu.
Update the position with the controls above. you will notive that the projected overlay is not positioned differently.

If you change the values for the initial position you will notice that the menu is positioned differently initially.

Hint: the second container below uses cdkOverlayOrigin and cdkConnectedOverlay for comparision.

Here's also a short video

CleanShot.2024.12.07.-.Google.Chrome-cdkMenu.-.StackBlitz-000231.mp4

Expected Behavior

The cdkMenu-Position should react to new values via cdkMenuPosition-input

Actual Behavior

See repro

Environment

  • Angular: 19.0.0
  • CDK/Material: 19.0.0
@michaelbe812 michaelbe812 added the needs triage This issue needs to be triaged by the team label Dec 7, 2024
@crisbeto crisbeto self-assigned this Dec 25, 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 needs triage This issue needs to be triaged by the team labels Dec 25, 2024
crisbeto added a commit to crisbeto/material2 that referenced this issue Dec 25, 2024
Fixes that the CDK menu wasn't updating its position strategy after the first open.

Fixes angular#30145.
@crisbeto crisbeto linked a pull request Dec 25, 2024 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
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