Compare commits

...

1 Commits

Author SHA1 Message Date
Timmy (AI Agent)
16c66e14a6 fix(a11y): set crisis overlay initial focus to Call 988 link (#69)
All checks were successful
Sanity Checks / sanity-test (pull_request) Successful in 8s
Smoke Test / smoke (pull_request) Successful in 16s
The overlay's showOverlay() called overlayDismissBtn.focus() after
setting overlayDismissBtn.disabled = true. Disabled buttons are not
valid focus targets per WCAG 2.4.3, so keyboard/AT users lost context
at the most critical point.

Fix: focus the Call 988 tel: link (first actionable, non-disabled
element) instead of the disabled dismiss button.

Changes:
- Add overlayCallLink variable from .overlay-call selector
- Focus overlayCallLink instead of overlayDismissBtn in showOverlay()
- Guard with null check for robustness

Closes #69
2026-04-14 14:10:19 -04:00

View File

@@ -808,6 +808,7 @@ Sovereignty and service always.`;
var crisisPanel = document.getElementById('crisis-panel');
var crisisOverlay = document.getElementById('crisis-overlay');
var overlayDismissBtn = document.getElementById('overlay-dismiss-btn');
var overlayCallLink = document.querySelector('#crisis-overlay .overlay-call');
var statusDot = document.querySelector('.status-dot');
var statusText = document.getElementById('status-text');
@@ -1002,7 +1003,11 @@ Sovereignty and service always.`;
}
}, 1000);
overlayDismissBtn.focus();
// Focus the Call 988 link — the first actionable (non-disabled) element.
// Disabled buttons are not valid focus targets (WCAG 2.4.3).
if (overlayCallLink) {
overlayCallLink.focus();
}
}
overlayDismissBtn.addEventListener('click', function() {