Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Block Navigation menu enabled even when there are no blocks #12040

Closed
afercia opened this issue Nov 18, 2018 · 0 comments
Closed

Block Navigation menu enabled even when there are no blocks #12040

afercia opened this issue Nov 18, 2018 · 0 comments
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).

Comments

@afercia
Copy link
Contributor

afercia commented Nov 18, 2018

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.

screenshot 2018-11-18 at 18 24 06

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:

  • they're not really disabled, they use an aria-disabled="true" attribute
  • they're still focusable
  • their tooltip is visible

As 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:

  • it uses a disabled attribute, so it's really disabled
  • it's not focusable
  • the tooltip is not visible

As it's not focusable and its tooltip is not visible, the discoverability of this tool is a bit reduced.

Block Navigation button:

  • it's always enabled
  • it's always focusable
  • the tooltip is visible
  • its popover is always rendered even when it's empty because there are no blocks inserted yet, which is a noticeable different behavior compared to the Content structure tool

From an accessibility perspective, using aria-disabled="true" and "noop'ing" an UI control is equivalent to disabling it with a disable attribute, as long as it is perceived as disabled by all users, i.e. also visually. The relevant difference is that a control with aria-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:

screenshot 2018-11-18 at 18 15 46

screenshot 2018-11-18 at 18 15 56

screenshot 2018-11-18 at 18 16 05

@afercia afercia added [Focus] Accessibility (a11y) Changes that impact accessibility and need corresponding review (e.g. markup changes). User Experience (UX) [Feature] List View Menu item in the top toolbar to select blocks from a list of links. labels Nov 18, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
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).
Projects
None yet
Development

No branches or pull requests

1 participant