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

Method onFocusOut

src/aria/private/menu/menu.ts:713–724  ·  view source on GitHub ↗

Handles focusout events for the menu trigger.

(event: FocusEvent)

Source from the content-addressed store, hash-verified

711
712 /** Handles focusout events for the menu trigger. */
713 onFocusOut(event: FocusEvent) {
714 const element = this.inputs.element();
715 const relatedTarget = event.relatedTarget as Node | null;
716
717 if (
718 this.expanded() &&
719 !element?.contains(relatedTarget) &&
720 !this.inputs.menu()?.inputs.element()?.contains(relatedTarget)
721 ) {
722 this.close();
723 }
724 }
725
726 /** Opens the menu. */
727 open(opts?: {first?: boolean; last?: boolean}) {

Callers

nothing calls this directly

Calls 4

closeMethod · 0.95
expandedMethod · 0.80
elementMethod · 0.45
menuMethod · 0.45

Tested by

no test coverage detected