Skip to content

Commit 0489ec1

Browse files
crisbetoandrewseguin
authored andcommitted
refactor(snack-bar): rework to account for ivy (#15536) (#15551)
Reworks the snack bar to account for a breaking change in Ivy.
1 parent 44f185b commit 0489ec1

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/lib/snack-bar/snack-bar-container.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,11 @@ import {MatSnackBarConfig} from './snack-bar-config';
4040
selector: 'snack-bar-container',
4141
templateUrl: 'snack-bar-container.html',
4242
styleUrls: ['snack-bar-container.css'],
43-
changeDetection: ChangeDetectionStrategy.OnPush,
43+
// In Ivy embedded views will be change detected from their declaration place, rather than
44+
// where they were stamped out. This means that we can't have the snack bar container be OnPush,
45+
// because it might cause snack bars that were opened from a template not to be out of date.
46+
// tslint:disable-next-line:validate-decorators
47+
changeDetection: ChangeDetectionStrategy.Default,
4448
encapsulation: ViewEncapsulation.None,
4549
animations: [matSnackBarAnimations.snackBarState],
4650
host: {

0 commit comments

Comments
 (0)