Skip to content

Improve toolbox behaviour for keyboard and screen reader users#11189

Open
microbit-robert wants to merge 7 commits intomicrosoft:masterfrom
microbit-robert:toolbox-sr
Open

Improve toolbox behaviour for keyboard and screen reader users#11189
microbit-robert wants to merge 7 commits intomicrosoft:masterfrom
microbit-robert:toolbox-sr

Conversation

@microbit-robert
Copy link
Contributor

This PR:

  • Uses a flat tree structure for the toolbox
    • This fixes the tree item count for screen readers (these tree items are now always in the DOM but visually hidden)
    • As there are no controls to expand or collapse the sub-categories (typically left/right arrow), we don't need levels of nesting or aria-levels. Categories are simply shown visually when navigated to
  • Aligns toolbox behaviour with Blockly
    • The selected category is remembered when navigating back to the toolbox. The previous behaviour hindered users when they needed to add more than one block from the same category.
  • Enter / Space on a category no longer toggles the flyout open / closed
    • This was observed to be a confusing behaviour for screen reader users
    • Enter / Space still opens the extensions overlay
    • Mouse clicks still toggle the flyout open / closed
  • Ensures that using the down arrow from the search input always focuses the first item in the toolbox rather than re-focusing the previously selected category - the latter is what the Tab key does
  • Renders the LED category in uppercase to improve screen reader output
    • When capitalised the screen reader outputs "L E D", otherwise "led"
    • LED is typically uppercase for translations, but this is not the case for the English text
  • Adds an id to the toolbox to ensure that code related to Blockly's focus manager runs (see fix: Short-circuit node lookups for missing IDs RaspberryPiFoundation/blockly#9174)

This improves screen reader output as the toolbox item count is
constant. This removes the notion of expanded, since there are
no controls to expand or collapse tree items, they are just shown
when navigated to.
Remember last selected category when focused.
Fix toolbox blur behaviour.
Fix bug when returning to the toolbox from the search flyout.
This still prevents Enter / Space from toggling the flyout open /
closed.
This is special casing the namespace as a low effort way to
achieve this. Translations already handle this in a better way
than English.
The screen reader output is faster and less ambigious this way
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant