fix(a11y): reminder picker modal focus-trap parity (LC-158) #210
Loading…
Reference in a new issue
No description provided.
Delete branch "chore/lc-158-reminder-modal-a11y"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
What
First slice of LC-158 (UI-pattern consolidation, audit gap C3): bring the reminder picker modal to focus-trap parity with the poll/scheduled modals.
Problem
The reminder picker is a full-screen overlay modal (
fixed inset-0,role="dialog") like poll/scheduled, but had no focus trap, no Escape-to-close, and no focus restoration - the weakest a11y of the overlay modals.Fix
Wire it onto the shared
window.__lcDialogTrap: capture the opener, trap Tab inside the dialog, move initial focus in, and route every cancel path (X, backdrop, Escape) through oneclose()that disposes the trap, restores focus to the opener, and clears the slot. Success paths (preset / custom POST) swap the confirm fragment into the slot - removing the dialog and its trap listener outright - so they need no explicit teardown. The inlineonclick/onmousedownhandlers are replaced by script-bound listeners so all paths share the teardown.The status picker is intentionally left as-is: it is an inline sidebar dropdown, not an overlay modal, and already has Escape + focus-restore. A Tab focus-trap (the only thing
__lcDialogTrapadds) would be wrong there - Tab should move out to the page, not cycle within a non-modal dropdown.Deferred (sub-issue)
The other C3 consolidation items - confirm-dialog pattern guideline (
hx-confirmvs nativeconfirm()vs text-verify), form-error fragment unification, and folding the mention-popover avatar back ontopartials/avatar.html- are filed as a follow-up; they are cosmetic/guideline and partly behavior-changing (e.g.hx-confirmonly guards htmx requests, not plain form submits), so not bundled here.Test
just check(Askama templates compile),routes_reminderstests green. JS trap/escape behavior is not unit-tested in this repo (consistent with the poll/scheduled modal JS); the change mirrors their established pattern.Part of the LC-159 post-audit story.
🤖 Generated with Claude Code