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

fix(material/menu): remove dependency on animations module #30099

Closed
wants to merge 1 commit into from

Conversation

crisbeto
Copy link
Member

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.

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.
@crisbeto crisbeto added the target: patch This PR is targeted for the next patch release label Nov 28, 2024
@crisbeto crisbeto requested a review from a team as a code owner November 28, 2024 10:07
@crisbeto crisbeto requested review from mmalerba and wagnermaciel and removed request for a team November 28, 2024 10:07
@@ -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++;
Copy link
Contributor

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.

Copy link
Member Author

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.

@crisbeto
Copy link
Member Author

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.

@crisbeto crisbeto closed this Nov 29, 2024
crisbeto added a commit to crisbeto/material2 that referenced this pull request Dec 11, 2024
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.
crisbeto added a commit to crisbeto/material2 that referenced this pull request Dec 11, 2024
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.
crisbeto added a commit to crisbeto/material2 that referenced this pull request Dec 11, 2024
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.
crisbeto added a commit that referenced this pull request Dec 13, 2024
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.
crisbeto added a commit that referenced this pull request Dec 13, 2024
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.

(cherry picked from commit 4620df1)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: material/menu target: patch This PR is targeted for the next patch release
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants