Skip to content

Commit 1566ab1

Browse files
committed
fix(material/slide-toggle): focus indication not showing inside OnPush parent (#26111)
Fixes that the focus indication wasn't showing up when the slide toggle is placed inside of an `OnPush` component. (cherry picked from commit 3d3767f)
1 parent f61a213 commit 1566ab1

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

src/material/slide-toggle/slide-toggle.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -180,6 +180,7 @@ export abstract class _MatSlideToggleBase<T>
180180
this._focusMonitor.monitor(this._elementRef, true).subscribe(focusOrigin => {
181181
if (focusOrigin === 'keyboard' || focusOrigin === 'program') {
182182
this._focused = true;
183+
this._changeDetectorRef.markForCheck();
183184
} else if (!focusOrigin) {
184185
// When a focused element becomes disabled, the browser *immediately* fires a blur event.
185186
// Angular does not expect events to be raised during change detection, so any state

0 commit comments

Comments
 (0)