mirror of
https://github.com/harvard-edge/cs249r_book.git
synced 2026-07-16 14:42:29 -05:00
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.