Skip to content

Keyboard Accessibility

Nodes and edges are in the tab order, a focused node that is out of view is panned into it, and every change is announced through a live region. The toolbar switches each part of that - which elements Tab reaches, keyboard support as a whole, the pan and its speed - and makes an announcement of the page's own.

submitapproverejectarchive
Submitted
In review
Approved
Rejected
Notified
Archived
Selection nothing selected
Announced by the page -
bit Blow

Try it

  • Click the background to give the canvas focus, then press Tab again and again: focus moves through the edges, then the nodes. The workflow is wider than the view, and when focus reaches a node outside it the view slides along to show it.
  • Press Enter or Space to select the focused node or edge (Shift+Enter adds it to the selection) - the panel names what is selected. Move a selection with the arrow keys, clear it with Escape and remove it with Delete.
  • Untick Edges focusable or Nodes focusable, then Tab again: that kind is skipped.
  • Tick Disable keyboard support: Tab skips every node and edge, and the arrow keys no longer move a selection made with the mouse.
  • Untick Pan to the focused node and Tab out of view: focus moves on, but the view stays put. Set over to 0 ms to jump instead of sliding, or 800 ms to watch the slide.
  • Select something and press Announce selection: the page puts a sentence of its own in the canvas's live region, and a screen reader reads it out.
  • Reset puts the workflow, the view and the panel back as they started.
  • With a screen reader on - Narrator, VoiceOver, NVDA - you hear each element's name and keys as focus arrives, and every selection, move and deletion as it happens. The Localization example shows those announcements on screen.

How it works

  • NodesFocusable and EdgesFocusable (both true) put each kind in the tab order; focus follows the order they are drawn in, edges beneath nodes. A node or an edge's own Focusable takes out just that one.
  • DisableKeyboardA11y (false) takes every node and edge out of the tab order and turns the arrow keys and connecting from the keyboard off; Delete and Escape still act on a selection.
  • AutoPanOnNodeFocus (true) pans a node that takes keyboard focus into view - only as far as needed, so the reader keeps their place - over AutoPanOnNodeFocusDuration milliseconds (200; 0 jumps).
  • Announce(message) puts a message of the app's own in the polite live region the canvas announces its changes in; saying the same thing twice is still read the second time.
  • AriaLabel names the canvas itself ("Approval workflow" rather than the default "Flow diagram"), and a node's AriaLabel - on In review here - replaces its Label as its spoken name.
  • OnSelectionChange fills the panel, which is a BlowPanel inside the canvas. DefaultViewport sets where the view opens; Reset returns there with SetViewport.
An unhandled error has occurred. Reload 🗙