Skip to content

Commit 8ee9369

Browse files
crisbetommalerba
authored andcommitted
fix(material/bottom-sheet): some changes not being picked up (#21175)
In some components, like the dialog and snack bar, we had to remove `OnPush` change detection some time ago, because the views inside the component were being detected at their declaration place. These changes apply the same fix to the bottom sheet. Fixes #21141. (cherry picked from commit d8afc38)
1 parent 0aa94ac commit 8ee9369

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/material/bottom-sheet/bottom-sheet-container.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,11 @@ import {FocusTrap, FocusTrapFactory} from '@angular/cdk/a11y';
4545
selector: 'mat-bottom-sheet-container',
4646
templateUrl: 'bottom-sheet-container.html',
4747
styleUrls: ['bottom-sheet-container.css'],
48-
changeDetection: ChangeDetectionStrategy.OnPush,
48+
// In Ivy embedded views will be change detected from their declaration place, rather than where
49+
// they were stamped out. This means that we can't have the bottom sheet container be OnPush,
50+
// because it might cause the sheets that were opened from a template not to be out of date.
51+
// tslint:disable-next-line:validate-decorators
52+
changeDetection: ChangeDetectionStrategy.Default,
4953
encapsulation: ViewEncapsulation.None,
5054
animations: [matBottomSheetAnimations.bottomSheetState],
5155
host: {

0 commit comments

Comments
 (0)