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 51ce874 commit 4513fb3Copy full SHA for 4513fb3
src/cdk/a11y/focus-monitor/focus-monitor.ts
@@ -186,13 +186,11 @@ export class FocusMonitor implements OnDestroy {
186
*/
187
private _documentFocusAndBlurListener = (event: FocusEvent) => {
188
const target = event.target as HTMLElement|null;
189
+ const handler = event.type === 'focus' ? this._onFocus : this._onBlur;
190
+
191
// We need to walk up the ancestor chain in order to support `checkChildren`.
192
for (let el = target; el; el = el.parentElement) {
- if (event.type === 'focus') {
- this._onFocus(event as FocusEvent, el);
193
- } else if (event.type === 'blur') {
194
- this._onBlur(event as FocusEvent, el);
195
- }
+ handler.call(this, event, el);
196
}
197
198
0 commit comments