Flushes any pending focus when the menu instance becomes available.
()
| 677 | |
| 678 | /** Flushes any pending focus when the menu instance becomes available. */ |
| 679 | pendingFocusEffect(): void { |
| 680 | const menu = this.inputs.menu(); |
| 681 | const intent = this.pendingFocus(); |
| 682 | if (menu && intent) { |
| 683 | if (intent === 'first') { |
| 684 | menu.first(); |
| 685 | } else if (intent === 'last') { |
| 686 | menu.last(); |
| 687 | } |
| 688 | this.pendingFocus.set(undefined); |
| 689 | } |
| 690 | } |
| 691 | |
| 692 | /** Handles keyboard events for the menu trigger. */ |
| 693 | onKeydown(event: KeyboardEvent) { |