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

Method pendingFocusEffect

src/aria/private/menu/menu.ts:683–698  ·  view source on GitHub ↗

Flushes any pending focus when the menu instance becomes available.

()

Source from the content-addressed store, hash-verified

681
682 /** Flushes any pending focus when the menu instance becomes available. */
683 pendingFocusEffect(): void {
684 const menu = this.inputs.menu();
685 const intent = this.pendingFocus();
686 const items = menu?.items();
687
688 // We check the items so that we don't try calling into
689 // `first/last` until the items are actually available.
690 if (menu && intent && items?.length) {
691 if (intent === 'first') {
692 menu.first();
693 } else if (intent === 'last') {
694 menu.last();
695 }
696 this.pendingFocus.set(undefined);
697 }
698 }
699
700 /** Handles keyboard events for the menu trigger. */
701 onKeydown(event: KeyboardEvent) {

Callers 2

getMenuTriggerPatternFunction · 0.95
constructorMethod · 0.80

Calls 4

setMethod · 0.80
menuMethod · 0.45
firstMethod · 0.45
lastMethod · 0.45

Tested by 1

getMenuTriggerPatternFunction · 0.76