Closed brunnerh closed 1 year ago
Thanks for the callout, I'm working on a fix.
I'll probably opt for a simple disclosure pattern with a button, since ARIA menu
usually isn't the right pattern for website navigation like this.
Opened an implementation in https://github.com/sveltejs/svelte/pull/8831, feedback welcome. It's in draft, but only because it's waiting on a site-kit release
Looks good, also appreciate that it fixes the vertical alignment of name & icon, that has been bugging me for a while 😄.
One note, I have moved from :focus
to :focus-visible
for most scenarios, that way you usually do not get stuck with an unnecessary focus style when clicking a button (since focus remains unlike hover).
This:
(
/src/routes/(authed)/repl/[id]/UserMenu.svelte
)The menu can only be used via mouse and lacks semantic roles.
Implementing a proper menu is non-trivial, though. Especially getting all the keyboard interactions and focus management right.
User name and avatar should probably be a button that only opens the menu on click. That change alone would go a long way.