Skip to content

Commit 7bbe68d

Browse files
authored
perf(material/bottom-sheet): do not run change detection when focusing element (#23965)
1 parent 02908ce commit 7bbe68d

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

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

+3-1
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)