{% comment %}
Which menu is open is tracked by element identity, so a menu needs no name and
the trigger and content find each other through their shared parent.
{% endcomment %}
trigger.parentElement.contains(document.activeElement)); if (at < 0 || ($event.key !== forth && $event.key !== back && $event.key !== 'Home' && $event.key !== 'End')) return; if (($event.key === 'Home' || $event.key === 'End') && !triggers.includes(document.activeElement)) return; $event.preventDefault(); const next = $event.key === 'Home' ? triggers[0] : $event.key === 'End' ? triggers.at(-1) : triggers[(at + ($event.key === forth ? 1 : -1) + triggers.length) % triggers.length]; if (active) { viaKeyboard = true; active = next.parentElement; } else next.focus();"
class="
flex h-9 items-center gap-1 rounded-md border bg-background p-1 shadow-xs
{% if class %}
{{ class }}
{% endif %}
" data-slot="menubar" {{ attrs }}>
{{ slot }}