Skip to content

Commit 73414a9

Browse files
arturovtzarend
authored andcommitted
perf(material/bottom-sheet): do not run change detection when focusing element (#23965)
(cherry picked from commit 7bbe68d)
1 parent a3f99f8 commit 73414a9

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

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

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -306,7 +306,9 @@ export class MatBottomSheetContainer extends BasePortalOutlet implements OnDestr
306306

307307
// The `focus` method isn't available during server-side rendering.
308308
if (this._elementRef.nativeElement.focus) {
309-
Promise.resolve().then(() => this._elementRef.nativeElement.focus());
309+
this._ngZone.runOutsideAngular(() => {
310+
Promise.resolve().then(() => this._elementRef.nativeElement.focus());
311+
});
310312
}
311313
}
312314
}

0 commit comments

Comments
 (0)