Live demo: the snackbar, before and after
Left is the original code from the UI Guidelines sample, unchanged. Right is the version with the audit's blockers fixed, also unchanged from the sample. Both run on React 18.3.1.
What this shows, and what it doesn't. Only the blockers were fixed, as the buyer asked, so the fixed version keeps the light green. White on #4CAF50 is about 2.78:1 (calculated), which fails 1.4.3 Contrast (Minimum) (AA). The audit lists that as a Serious finding still to fix. Nothing here has been tested with a screen reader, and it is not a claim that either version meets WCAG 2.2 AA.
Before
After (blockers fixed)
Things to try
- Press "Archive invoice #1042" on each side. The original vanishes after 3 seconds, Undo and all. The fixed one stays until you press Undo or Close.
- Use the keyboard only. On the left you can't reach Undo or ×: they are spans, not buttons. On the right, Tab reaches both, and each shows a focus ring.
- Close the fixed one with the keyboard: focus goes back to the button you came from.
- With a screen reader, the fixed one is added to a live region that is already in the page, so it can be announced. Check that on your own devices.