Improve toolbar accessibility by following W3C APG Toolbar example

Closed
RI
5mo ago
+2159-384

This improves the toolbar accessibility by following the W3C APG Toolbar example and standards.

  • Gives the toolbar a roving tabindex
  • Left / Right / Home / End toolbar navigation
  • Toolbar focus is remembered between edits and going back to the toolbar

Summary by cubic

Makes the formatting toolbar follow the W3C APG Toolbar pattern for better accessibility. Adds predictable keyboard navigation, accurate pressed states, and stable focus between the editor and toolbar.

  • New Features
    • Roving tabindex across toolbar items with Left/Right/Home/End navigation; focus is remembered when returning from the toolbar.
    • ARIA: toolbar now links to the textarea via aria-controls; auto-ids are created when missing; toggle buttons update aria-pressed.
    • Button API: added isActive to set pressed state and the active class, plus optional actionId for canonical actions.
    • Docs and tests: README documents isActive; added test/toolbar.test.js; npm test includes the new suite.