Skip to content

Commit 4513fb3

Browse files
mleibmanmmalerba
authored andcommitted
Cleanup
1 parent 51ce874 commit 4513fb3

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

src/cdk/a11y/focus-monitor/focus-monitor.ts

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -186,13 +186,11 @@ export class FocusMonitor implements OnDestroy {
186186
*/
187187
private _documentFocusAndBlurListener = (event: FocusEvent) => {
188188
const target = event.target as HTMLElement|null;
189+
const handler = event.type === 'focus' ? this._onFocus : this._onBlur;
190+
189191
// We need to walk up the ancestor chain in order to support `checkChildren`.
190192
for (let el = target; el; el = el.parentElement) {
191-
if (event.type === 'focus') {
192-
this._onFocus(event as FocusEvent, el);
193-
} else if (event.type === 'blur') {
194-
this._onBlur(event as FocusEvent, el);
195-
}
193+
handler.call(this, event, el);
196194
}
197195
}
198196

0 commit comments

Comments
 (0)