-
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
fix(material/menu): remove dependency on animations module #30099
Conversation
Reworks the menu so it no longer depends on the animations module. This should allow us to avoid some of the pitfalls of the animations module like occasional memory leaks (e.g. #47748) and reduce the bundle size.
@@ -85,15 +84,15 @@ export class MatMenuContent implements OnDestroy { | |||
// it needs to check for new menu items and update the `@ContentChild` in `MatMenu`. | |||
this._changeDetectorRef.markForCheck(); | |||
this._portal.attach(this._outlet, context); | |||
this._attached.next(); | |||
this._attachCount++; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Seems like you jut increase this counter, but never decrease it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's intentional, because if the content gets detached and re-attached to a different panel, it'll stay at 1.
Will pause this for now. It ended up being a bit tricky to land, because there's a lot of the menu lifecycle that's tied to the animations. Also there was an error being thrown when hovering quickly over the nested menu items in the demo. |
Second attempt at reworking the menu so it no longer depends on the animations module (after angular#30099). This should allow us to avoid some of the pitfalls of the animations module like occasional memory leaks (e.g. #47748) and reduce the bundle size.
Second attempt at reworking the menu so it no longer depends on the animations module (after angular#30099). This should allow us to avoid some of the pitfalls of the animations module like occasional memory leaks (e.g. #47748) and reduce the bundle size.
Second attempt at reworking the menu so it no longer depends on the animations module (after angular#30099). This should allow us to avoid some of the pitfalls of the animations module like occasional memory leaks (e.g. #47748) and reduce the bundle size.
Second attempt at reworking the menu so it no longer depends on the animations module (after #30099). This should allow us to avoid some of the pitfalls of the animations module like occasional memory leaks (e.g. #47748) and reduce the bundle size.
Reworks the menu so it no longer depends on the animations module. This should allow us to avoid some of the pitfalls of the animations module like occasional memory leaks (e.g. #47748) and reduce the bundle size.