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 position from fixed trigger element #12220

Closed
Trysor opened this issue Jul 15, 2018 · 2 comments
Closed

Mat menu position from fixed trigger element #12220

Trysor opened this issue Jul 15, 2018 · 2 comments

Comments

@Trysor
Copy link

Trysor commented Jul 15, 2018

Bug, feature request, or proposal:

When the trigger for a matMenu is within or itself a position: fixed element, the menu ignores it and appears relative to the scroll position of the page.

What is the expected behavior?

For the menu to appear as intended, given its input values, relative to its trigger, regardless of having scrolled, and regardless of fixed, absolute or static positioning values of the trigger or the trigger's ancestors.

What is the current behavior?

The matMenu appears further down the page if the page has scrolled; not relative to its trigger. If you continue to scroll with the menu open the menu will go up or down with the page.

What are the steps to reproduce?

  1. Create a trigger within a div that is fixed to the top of the page.
  2. Add a matMenu to be triggered. Can also be a child of said div -- does not matter.
  3. Add content or styling such that the page has a sizeable scroll
  4. Load page, scroll partially down the page, trigger the menu

What is the use-case or motivation for changing an existing behavior?

Allow menus to be triggered from fixed elements; such as sticky headers

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

Angular: 6.1.0-rc.0
Material / CDK: 6.3.3

Is there anything else we should know?

"Bob" at the top is the trigger:

2018-07-15_18-02-31

@crisbeto
Copy link
Member

Duplicate of #11365.

@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 9, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants