Handles focusout events for the menu bar.
(event: FocusEvent)
| 606 | |
| 607 | /** Handles focusout events for the menu bar. */ |
| 608 | onFocusOut(event: FocusEvent) { |
| 609 | const relatedTarget = event.relatedTarget as Node | null; |
| 610 | |
| 611 | if (!this.inputs.element()?.contains(relatedTarget)) { |
| 612 | this.isFocused.set(false); |
| 613 | this.close(); |
| 614 | } |
| 615 | } |
| 616 | |
| 617 | /** Goes to and optionally focuses the specified menu item. */ |
| 618 | goto(item: MenuItemPattern<V>, opts?: {focusElement?: boolean}) { |