We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent dc448e3 commit d408ec4Copy full SHA for d408ec4
src/cdk/a11y/focus-monitor/focus-monitor.ts
@@ -139,13 +139,11 @@ export class FocusMonitor implements OnDestroy {
139
*/
140
private _documentFocusAndBlurListener = (event: FocusEvent) => {
141
const target = event.target as HTMLElement|null;
142
+ const handler = event.type === 'focus' ? this._onFocus : this._onBlur;
143
+
144
// We need to walk up the ancestor chain in order to support `checkChildren`.
145
for (let el = target; el; el = el.parentElement) {
- if (event.type === 'focus') {
- this._onFocus(event as FocusEvent, el);
146
- } else if (event.type === 'blur') {
147
- this._onBlur(event as FocusEvent, el);
148
- }
+ handler.call(this, event, el);
149
}
150
151
0 commit comments