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

Mat-Menu alignment problem with horizontal scrolling #16009

Closed
tmsteem82dev opened this issue May 13, 2019 · 3 comments · Fixed by #16235
Closed

Mat-Menu alignment problem with horizontal scrolling #16009

tmsteem82dev opened this issue May 13, 2019 · 3 comments · Fixed by #16235
Assignees
Labels
P2 The issue is important to a large percentage of users, with a workaround

Comments

@tmsteem82dev
Copy link

What is the expected behavior?

The mat-menu should be aligned to the trigger button. Even when the user has scrolled to the right. This appears to have worked fine in the past (2.0.0-beta.12?):
https://stackblitz.com/edit/dynamic-nested-menus-2ky78m

What is the current behavior?

The mat-menu is offset when opened after scrolling to the right.
Also, scrolling horizontally while the menu is open, the menu and the button are moved in different ways so that they're no longer aligned.

Especially noticeable when the button that triggers the menu is pushed to the right side by some form of styling or just plain text.

What are the steps to reproduce?

Resize the preview window so a horizontal scrollbar shows up:
https://stackblitz.com/edit/angular-bjqru6

Another example:
https://stackblitz.com/edit/angular-cnldxy

Which versions of Angular, Material, OS, TypeScript, browsers are affected?

Tested on Firefox and Chrome on Ubuntu 18.
I have tried it with @angular/material version 7.3.7 and 7.2.0 because in #11365 someone said a scrolling issue was fixed in 7.2.0.

@andrewseguin andrewseguin added the P2 The issue is important to a large percentage of users, with a workaround label May 15, 2019
@phodal
Copy link

phodal commented May 17, 2019

Have same issue with @angular/material 7.3.7 and Angular 7.1.1

@crisbeto crisbeto self-assigned this Jun 8, 2019
@crisbeto crisbeto added the has pr label Jun 8, 2019
crisbeto added a commit to crisbeto/material2 that referenced this issue Jun 8, 2019
…horizontally and overlay is anchored to the right

Fixes the flexible connected position strategy calculating where to position the panel incorrectly if it's anchored so that its content flows to the left and the page is scrolled horizontally. Furthermore, the calculations for the bounding box width weren't correct for this case either.

Fixes angular#16009.
crisbeto added a commit to crisbeto/material2 that referenced this issue Jun 8, 2019
…horizontally and overlay is anchored to the right

Fixes the flexible connected position strategy calculating where to position the panel incorrectly if it's anchored so that its content flows to the left and the page is scrolled horizontally. Furthermore, the calculations for the bounding box width weren't correct for this case either.

Fixes angular#16009.
mmalerba pushed a commit that referenced this issue Jun 10, 2019
…horizontally and overlay is anchored to the right (#16235)

Fixes the flexible connected position strategy calculating where to position the panel incorrectly if it's anchored so that its content flows to the left and the page is scrolled horizontally. Furthermore, the calculations for the bounding box width weren't correct for this case either.

Fixes #16009.
@pshurygin
Copy link

@crisbeto Any chances this is backported into v7? Thats a pretty annoying issue.

RudolfFrederiksen pushed a commit to RudolfFrederiksen/material2 that referenced this issue Jun 21, 2019
…horizontally and overlay is anchored to the right (angular#16235)

Fixes the flexible connected position strategy calculating where to position the panel incorrectly if it's anchored so that its content flows to the left and the page is scrolled horizontally. Furthermore, the calculations for the bounding box width weren't correct for this case either.

Fixes angular#16009.
@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 Sep 11, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
P2 The issue is important to a large percentage of users, with a workaround
Projects
None yet
5 participants