Skip to content

pantoken-root / formats/interactions/src / initMenu

Function: initMenu() ​

initMenu(menu, trigger): MenuHandle

Wire a vertical, single-level ARIA menu and its native popover button. Arrow keys wrap; Home/End and initial-character search move focus. Escape returns focus to the button; Tab closes without cancelling normal sequential navigation. Applications own click actions and checked state. Space activates checkable items without closing; Enter and pointer activation close unless the click is cancelled.

Parameters ​

HTMLElement

trigger ​

HTMLButtonElement

Returns ​

MenuHandle