Design Engineering Tip:
On macOS, a menu item blinks once before the menu closes. It confirms your click landed on the right item. Most web menus close on the same frame.
A quick blink is enough:
async function select(item) {
setHighlighted(false)
await wait(90)
setHighlighted(true)
await wait(90)
closeMenu()
}