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

Method onFocusIn

src/aria/private/menu/menu.ts:595–605  ·  view source on GitHub ↗

Handles focusin events for the menu bar.

(event?: FocusEvent)

Source from the content-addressed store, hash-verified

593
594 /** Handles focusin events for the menu bar. */
595 onFocusIn(event?: FocusEvent) {
596 this.isFocused.set(true);
597 this.hasBeenInteracted.set(true);
598
599 const item = event && _getMenuItem(event, this.inputs.items());
600 const prevItem = this.inputs.activeItem();
601 this.listBehavior.sync(item);
602 if (prevItem?.expanded() && prevItem !== this.inputs.activeItem()) {
603 prevItem.close();
604 }
605 }
606
607 /** Handles focusout events for the menu bar. */
608 onFocusOut(event: FocusEvent) {

Callers

nothing calls this directly

Calls 6

_getMenuItemFunction · 0.85
setMethod · 0.80
activeItemMethod · 0.80
expandedMethod · 0.80
syncMethod · 0.45
closeMethod · 0.45

Tested by

no test coverage detected