Open callumbwhyte opened 2 years ago
I tested this with a keyboard and poked around in inspector. I can confirm that there's currently no way to reorder items with the keyboard, but the controls use <button>
elements so other functionality is either already keyboard accessible or has more easily-fixable issues:
aria-expanded
attribute that gets toggled to match the current state, so that screen reader users can tell when it's open (also, it will inform screen reader users that the button can expand without having to include "Toggle" in the accessible name)When you say keyboard shortcuts, do you mean something like a hotkey to a specific functionality (like using letter keys with a modifier key)? If so, that's probably unnecessary for accessibility. (Some combination of tab/shift+tab, space/enter, and arrow keys should be sufficient.)
Oh, I forgot one thing. If I recall correctly, the visibility toggle needs a state so screen reader users will know whether it's active or not. aria-pressed
is probably fine.
Thank you so much @eden-jh, this is very thorough! Looks like we have some easily actionable items which is great.
I’ve taken a look at the item actions being visible on focus, I believe we already have most of the styles required for this we’re just missing a tabindex
on the outer nav item and the actions itself as they’re not inputs.
As for my initial comment about keyboard shortcuts, this wasn’t so much with accessibility in mind but for improving speed for power users. I think being able to add, edit, toggle collapsed / visible, for nav items with a hot key would be cool. Additionally indenting items via a hotkey. I’m not sure what best practice would be here, so as not to interfere with other browser functions or accessibility tools. I’m guessing Alt+something, and perhaps only when a specific item is in focus. Would love your ideas here.
Thanks again!
Ah, okay. Yeah, per WCAG 2.4.1 (Character Key Shortcuts) as long as there's a non-character modifier key included, shortcuts should not interfere with assistive technology.
As far as basic keyboard functionality for moving items, I did some research on accessible patterns for reordering, and I see two main implementations that could be useful here:
A version of approach 2 that requires you to re-open the menu after every move so you can choose "Move Up" a million times is not super usable, and I'm not sure it makes sense to keep the menu open as it's moved. Maybe including both approaches would be the most usable? A user can use the "Move into Submenu X" option to get a menu item into the right submenu, and then use the arrow keys to get it into the right position.
Some additional concerns for screen readers:
aria-grabbed
apparently exists but I'm not sure how well it's supported), and the results of their actions (e.g. when they successfully move an item)list-style: none
so it'll be important to test and make sure that hierarchical relationships are conveyed to screen reader users.Here are some examples. Just as a note, there are two examples of approach 1 here that don't have the interaction mode issue, but they both use a listbox role which is not appropriate for the nav editor:
Now V2 / V3 is out, it would be awesome to improve the ability to navigate / tab around the Meganav in the backoffice with a keyboard. This will significantly improve both the accessibility and usability of the package.
Umbraco has come a long way with this in recent years and so most of the components being used work pretty well, just could be even better.
I can imagine there's several places where the tab index is off or triggers the wrong thing.
I'd love to see keyboard shortcuts for:
Marking this as "help wanted" to see if any helpful people out there want to have a go 😎