Announcing What Changed
The specific problem with React. Content appears and disappears without a page load. Someone reading the screen visually notices immediately. Someone using a screen reader is told nothing, because nothing about the document told the browser to say anything.
This affects exactly the four states from module 7: results arriving, errors appearing, empty states, and loading finishing.
Live regions. Mark the element that changes so it is announced when it updates.
role="alert" for errors, announced immediately and interrupting.
aria-live="polite" for status, announced at the next natural pause.
The element must exist in the document before the message appears. Rendering the live region and its content at the same moment often announces nothing, because there was no change to notice.
Mark this lesson complete
Signed in, your progress follows you to every device.