-
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> content is active even if not opened #9915
Comments
BTW same problem with mat-select's mat-option elements i.e. are active even though select popup is not opened (maybe even the same issue if is using same menu popup code?). |
Currently the lazily-rendered content is maintained in the background while a menu is open. These changes switch to detaching it once the user closes the menu. Fixes angular#9915.
Currently the lazily-rendered content is maintained in the background while a menu is open. These changes switch to detaching it once the user closes the menu. Fixes angular#9915.
Currently the lazily-rendered content is maintained in the background while a menu is open. These changes switch to detaching it once the user closes the menu. Fixes angular#9915.
Currently the lazily-rendered content is maintained in the background while a menu is open. These changes switch to detaching it once the user closes the menu. Fixes angular#9915.
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?
So long as the menu is not opened I would expect the mat-menu content to not be active (similar to *ngIf="false" directive).
What is the current behavior?
Even if ng-template matMenuContent is used after the menu was opened once and the menu is currently not opened, mat-menu content seems to be active i.e. the components therein seem to be rendered as far as Angular is concerned according to e.g. property getter breakpoints.
What are the steps to reproduce?
Providing a StackBlitz reproduction is the best way to share your issue.
https://stackblitz.com/edit/angular-material2-issue-9dp31o
Couldn't use ng-template matMenuContent here, but even with it in the newer version after opening and closing once content stays active.
What is the use-case or motivation for changing an existing behavior?
Motivation is reducing of unnecessary performance hits (in fact I found that out looking at the Chrome performance devtools).
Which versions of Angular, Material, OS, TypeScript, browsers are affected?
Angular 5.2.0, Material 5.2.0, Windows, TS 2.5.3, Chrome.
Is there anything else we should know?
The text was updated successfully, but these errors were encountered: