components icon indicating copy to clipboard operation
components copied to clipboard

MatMenu overlay position issue

Open isametal88 opened this issue 8 years ago • 3 comments

Bug, feature request, or proposal:

Bug

What is the expected behavior?

MatMenu should use xPosition and yPosition, and overlap the trigger by default

What is the current behavior?

xPosition and yPosition are ignored, the overlay position is incorrect

What are the steps to reproduce?

https://stackblitz.com/edit/angular-ofiauh

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

-

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

angular 6.0.0.

Is there anything else we should know?

My issue is in a more complex environment, but the example I provided above is the simplest possible.

isametal88 avatar May 08 '18 12:05 isametal88

@isametal88 your example doesn't work, because you haven't included Material's structural styles which are required for the menu positioning. There's also a warning being logged from Material that these styles are missing. Here's a working fork of your example. The only change is adding the following to the style.css:

@import '~@angular/material/prebuilt-themes/deeppurple-amber.css';

crisbeto avatar May 08 '18 14:05 crisbeto

Thank you so much for your quick response. Yes, I was missing that part, my bad. Everything works properly now. Thank you again.

isametal88 avatar May 08 '18 14:05 isametal88

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.