-
Notifications
You must be signed in to change notification settings - Fork 6.8k
fix(menu): mark lazy menu content as dirty before attach #16506
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
Conversation
src/material/menu/menu-content.ts
Outdated
@@ -39,7 +40,8 @@ export class MatMenuContent implements OnDestroy { | |||
private _appRef: ApplicationRef, | |||
private _injector: Injector, | |||
private _viewContainerRef: ViewContainerRef, | |||
@Inject(DOCUMENT) private _document: any) {} | |||
@Inject(DOCUMENT) private _document: any, | |||
private _changeDetectorRef: ChangeDetectorRef) {} |
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.
_changeDetectorRef
should be marked as optional?
b3c0d67
to
8c039f4
Compare
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.
LGTM
src/material/menu/menu-content.ts
Outdated
@@ -39,7 +41,8 @@ export class MatMenuContent implements OnDestroy { | |||
private _appRef: ApplicationRef, | |||
private _injector: Injector, | |||
private _viewContainerRef: ViewContainerRef, | |||
@Inject(DOCUMENT) private _document: any) {} | |||
@Inject(DOCUMENT) private _document: any, | |||
@Optional() private _changeDetectorRef: ChangeDetectorRef) {} |
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.
The @Optional
won't help with backwards compatibility. It should be marked as an optional parameter (_changeDetectorRef?: ChangeDetectorRef
). Also I think we can drop the @Optional
since we'll always have a ChangeDetectorRef
.
61d23b2
to
1203427
Compare
This fixes a Google presubmit issue where the menu's `@ContentChildren` aren't updated after attaching lazy `MatMenuContent`.
1203427
to
6ccf235
Compare
This fixes a Google presubmit issue where the menu's `@ContentChildren` aren't updated after attaching lazy `MatMenuContent`.
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. |
This fixes a Google presubmit issue where the menu's
@ContentChildren
aren't updated after attaching lazy
MatMenuContent
.