Command Palette

Search for a command to run...

Hectal
Back to the lesson: Topic 15.6 — Auditing a Chart
Data Visualization · Example 2 of 2

Is the widget a keyboard trap?

A dispatched Tab does not move focus by itself, so the test reads defaultPrevented: whether the widget would have stopped the browser from moving it.

Run a short, repeatable audit on every chart: a handful of yes-or-no checks, an automated scan with its limits understood, and a session with a real screen reader user. Automation finds a missing name. Only a person finds a useless one.

Change the code and press Run (Ctrl+Enter). Predict what will happen first, then break it on purpose and read what changes. Your edits are saved and match the lesson page.

Ready for more? This phase has 5 hands-on exercises with automatic checks.

Practice questions

Write the code in the editor, run it, then open the model answer to compare.

01

Add a seventh check to audit: the chart's description is not longer than 600 characters.

02

Write the one-line axe call that returns the list of violation ids for the whole page (with axe-core loaded).

Explain it without notes

01

What does an automated scan find, and what does it miss?

02

Why a short checklist instead of a long standard?

03

What would you ask a screen reader user to do in a test session?

04

Where do you put the audit so it keeps running?

Is the widget a keyboard trap?

Console

(nothing was printed)

Expected console output

handles arrows only  | ArrowRight taken, Tab left alone, Escape left alone
swallows every key   | ArrowRight taken, Tab taken, Escape taken
A Tab that is 'taken' means the browser will not move focus on: a person using the keyboard is stuck.