MCPcopy Create free account
hub / github.com/angular/components / _handleFocus

Function _handleFocus

src/cdk/menu/menu-base.ts:266–277  ·  view source on GitHub ↗

Handles focus landing on the host element of the menu.

()

Source from the content-addressed store, hash-verified

264
265 /** Handles focus landing on the host element of the menu. */
266 private _handleFocus() {
267 this._focusMonitor
268 .monitor(this.nativeElement, false)
269 .pipe(takeUntil(this.destroyed))
270 .subscribe(origin => {
271 // Don't forward focus on mouse interactions, because it can
272 // mess with the user's scroll position. See #30130.
273 if (origin !== null && origin !== 'mouse') {
274 this.focusFirstItem(origin);
275 }
276 });
277 }
278}

Callers

nothing calls this directly

Calls 2

focusFirstItemMethod · 0.65
monitorMethod · 0.45

Tested by

no test coverage detected