Block Navigation menu enabled even when there are no blocks #12040
Labels
[Feature] List View
Menu item in the top toolbar to select blocks from a list of links.
[Focus] Accessibility (a11y)
Changes that impact accessibility and need corresponding review (e.g. markup changes).
When a post doesn't have blocks yet, for example because it's a newly created post, the Block Navigation menu is enabled even though there are no blocks to list. Clicking the button shows a popover with the message "No blocks created yet." which is a bit pointless.
Not sure this is the more consistent user experience as, for example, the "Content structure" tool which is there in the UI, close to the Block Navigation menu, has actually the opposite behavior: it is disabled because there are no headings or content to analyze yet.
Checking the semantics and interaction consistency of all the buttons in this part of the UI, seems there are at least 3 different initial behaviors that are potentially confusing for users:
Undo and Redo buttons:
aria-disabled="true"
attributeAs discussed in previous issues / PRs, they're not disabled to avoid a focus loss when using a keyboard and there are no more undo / redo steps.
Content structure button:
disabled
attribute, so it's really disabledAs it's not focusable and its tooltip is not visible, the discoverability of this tool is a bit reduced.
Block Navigation button:
From an accessibility perspective, using
aria-disabled="true"
and "noop'ing" an UI control is equivalent to disabling it with adisable
attribute, as long as it is perceived as disabled by all users, i.e. also visually. The relevant difference is that a control witharia-disabled="true"
is still focusable. Removing focusability from disabled elements can offer users both advantages and disadvantages. A must read recommendation can be found in the ARIA authoring practices:5.7 Focusability of disabled controls
https://www.w3.org/TR/wai-aria-practices-1.1/#kbd_disabled_controls
Although those recommendations apply to ARIA widgets, the Gutenberg top bar can be considered a "toolbar", where the ability to discover the functionalities within the toolbar is a primary concern. I'd recommend to adopt a consistent convention for the focusability of these controls and always use
aria-disabled="true"
/ "noop". The Block navigation menu should not open its panel when there are no blocks.Lastly, minor but important for consistency: sometimes the tooltips use sentence case, sometimes title case:
The text was updated successfully, but these errors were encountered: