components
components copied to clipboard
fix(material/dialog): `mat-dialog-title` should work under `OnPush` `viewContainerRef`
The mat-dialog-title
directive updates state in a microtask and should call ChangeDetectorRef.markForCheck
. Failing to do this will cause the component tree to not be checked if it lives under an OnPush
component that has not otherwise been marked for check.
@crisbeto PTAL - I had to update the fix to put the ChangeDetectorRef
on the dialog container itself because the title also modifies the queue in its ngOnDestroy
and I can't use its ChangeDetectorRef
at that point. I assumed MatDialogContainer
wasn't public API and that this would be okay.
Edit: I saw there was a golden failure for public API change so I updated the ChangeDetectorRef
to be @internal
.
caretaker note: I'm not sure how merging is handled when changes affect the legacy components internally. This change will require deleting the _changeDetectorRef
from the MatLegacyDialogContainer
since it's now in the base class and protected
Green TGP with local change mentioned above (remove _changeDetectorRef
from constructor of ...legacy-dialog/dialog-container.ts)
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.