Skip to content

Commit 93fc4ff

Browse files
committed
fix(): OnPush does not work for the SidenavLayout.
1 parent f711d8a commit 93fc4ff

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/components/sidenav/sidenav.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -244,7 +244,9 @@ export class MdSidenav {
244244
directives: [MdSidenav],
245245
templateUrl: './components/sidenav/sidenav.html',
246246
styleUrls: ['./components/sidenav/sidenav.css'],
247-
changeDetection: ChangeDetectionStrategy.OnPush,
247+
// Do not use ChangeDetectionStrategy.OnPush. It does not work for this component because
248+
// technically it is a sibling of MdSidenav (on the content tree) and isn't updated when MdSidenav
249+
// changes its state.
248250
})
249251
export class MdSidenavLayout implements AfterContentInit {
250252
@ContentChildren(MdSidenav) private sidenavs_: QueryList<MdSidenav>;

0 commit comments

Comments
 (0)