-
Notifications
You must be signed in to change notification settings - Fork 6.8k
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 not scrolled to top on first open #11790
Comments
…rst time Fixes a menu with a scrollable content not being scrolled to the top when it's opened for the first time. The issue seems to come from the fact that the browser is thrown off by us moving focus while the menu is still animating. Fixes angular#11790.
I'm running into this issue on v7.0.4, except its showing during animation. Looks like the fix resets scrollTop on animation done, but the scroll top is wrong during animation and looks janky https://stackblitz.com/edit/angular-ej8quc?file=app/menu-overview-example.html While the menu is animating open, the scroll top is set to 31px and then it resets to 0px once open. |
…scrollable menu Originally in angular#11859 we introduced some logic that makes sure that the menu panel is always scrolled to the top when it's open. This works, but is janky, because the user can see the menu being scrolled down while it's animating. These changes move the logic, that reset the scroll position, from the `done` callback to `start`. Fixes angular#11790.
…scrollable menu (#14190) Originally in #11859 we introduced some logic that makes sure that the menu panel is always scrolled to the top when it's open. This works, but is janky, because the user can see the menu being scrolled down while it's animating. These changes move the logic, that reset the scroll position, from the `done` callback to `start`. Fixes #11790.
…scrollable menu (angular#14190) Originally in angular#11859 we introduced some logic that makes sure that the menu panel is always scrolled to the top when it's open. This works, but is janky, because the user can see the menu being scrolled down while it's animating. These changes move the logic, that reset the scroll position, from the `done` callback to `start`. Fixes angular#11790.
This issue has been automatically locked due to inactivity. Read more about our automatic conversation locking policy. This action has been performed automatically by a bot. |
Bug, feature request, or proposal:
Bug
What is the expected behavior?
When opening a mat-menu with scrollable content the content should be scrolled to the top.
What is the current behavior?
When opening a mat-menu with scrollable content for the first time after it is created the content is scrolled down slightly.

What are the steps to reproduce?
https://stackblitz.com/edit/mat-menu-scroll-issue
What is the use-case or motivation for changing an existing behavior?
The top-most item in a menu should be fully visible after opening the menu.
Which versions of Angular, Material, OS, TypeScript, browsers are affected?
The text was updated successfully, but these errors were encountered: