Files
Farhan Asghar a9039df6de a11y(shared): make subscribe modal a real dialog for keyboard and screen-reader users (#1948)
The subscribe modal (shared across the book, site, labs, kits, and
mlsysim subsites) was a plain div overlay:

- No role="dialog", aria-modal, or accessible name, so screen readers
  never announced it as a dialog and could wander into the page
  behind the overlay.
- No focus trap: Tab walked out of the modal into the visually hidden
  background page.
- Focus was never returned to the triggering element on close, dropping
  keyboard users at the top of the document.
- Open/close animations played regardless of prefers-reduced-motion.

Changes to the canonical shared/scripts/subscribe-modal.js:

- role="dialog" aria-modal="true" aria-labelledby on the container,
  with an id on the existing title.
- Tab/Shift+Tab now cycle within the modal's visible, enabled controls
  (computed per keypress, so the trap also works on the post-submit
  success view).
- The opener element is saved on openModal() and refocused on close.
- Animations are disabled under prefers-reduced-motion: reduce.

Mirrors regenerated with shared/scripts/sync-mirrors.sh (CI drift
check). Escape-to-close and overlay-click behavior unchanged.
2026-07-15 11:47:26 +02:00
..