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

Menu fails to reposition itself inside the window in some circumstances. #5063

Closed
DeadWisdom opened this issue Oct 7, 2023 · 2 comments · Fixed by #5082 or #5005 · May be fixed by X-oss-byte/pigweed#61, X-oss-byte/pigweed#70 or X-oss-byte/pigweed#73
Assignees

Comments

@DeadWisdom
Copy link

What is affected?

Component

Description

When I open my md-menu component that is anchored on the button at the top right of the screen, I expect it to neatly position inside...

Unfortunately it appears off the screen:

image

I worked out the reason is thus:

I won't go into solutioning to much, but I believe the best idea is to store the window width before adding it to the screen.

Reproduction

I am unable to reproduce in the playground because it doesn't seem to position correctly there either.

But...

  • Make a menu
  • Put it in the top right corner
  • Ensure that if it's container grows it would grow the innerWidth of the window

Workaround

I haven't figured out the best work around yet. I think for now I will probably just have the menu be fixed.

Is this a regression?

No or unsure. This never worked, or I haven't tried before.

Affected versions

1.0.0

Browser/OS/Node environment

  • Chrome 117.0.5938.149
  • Windows 10
  • npm 8.19.2
  • node 16.18.1
@e111077
Copy link
Contributor

e111077 commented Oct 10, 2023

Thanks for the detailed breakdown. It seems like we need to simply store the inner widths and heights before we display the menu with opacity: 0

@e111077 e111077 self-assigned this Oct 10, 2023
copybara-service bot pushed a commit that referenced this issue Oct 17, 2023
fixes #5063

PiperOrigin-RevId: 572180661
copybara-service bot pushed a commit that referenced this issue Oct 17, 2023
fixes #5063

PiperOrigin-RevId: 572180661
@e111077
Copy link
Contributor

e111077 commented Oct 17, 2023

Implemented your fix, but unable to verify. Please reopen if it doesn't solve the issue on next MWC release

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment