fix: overlay initial focus targets enabled element (closes #90, refs #69) #107

Closed
Rockachopa wants to merge 1 commits from fix/90-overlay-focus-enabled-element into main
Owner

Closes #90
Refs #69

Problem

When crisis overlay opens, showOverlay():

  1. Disables the dismiss button (overlayDismissBtn.disabled = true)
  2. Calls overlayDismissBtn.focus()

Disabled buttons cannot receive focus. The overlay opens without a valid keyboard focus target.

Fix

Focus the Call 988 link (.overlay-call) instead — always enabled, most important action.

Changes

  • index.html: Focus .overlay-call link on overlay open instead of disabled dismiss button
  • tests/test_crisis_overlay_focus_trap.py: Added 2 new tests verifying focus targets enabled element

Tests

7 tests passing (all in test_crisis_overlay_focus_trap.py)

Closes #90 Refs #69 ## Problem When crisis overlay opens, `showOverlay()`: 1. Disables the dismiss button (`overlayDismissBtn.disabled = true`) 2. Calls `overlayDismissBtn.focus()` Disabled buttons cannot receive focus. The overlay opens without a valid keyboard focus target. ## Fix Focus the Call 988 link (`.overlay-call`) instead — always enabled, most important action. ## Changes - `index.html`: Focus `.overlay-call` link on overlay open instead of disabled dismiss button - `tests/test_crisis_overlay_focus_trap.py`: Added 2 new tests verifying focus targets enabled element ## Tests 7 tests passing (all in `test_crisis_overlay_focus_trap.py`)
Rockachopa added 1 commit 2026-04-15 03:25:49 +00:00
fix: overlay initial focus targets enabled element (closes #90, refs #69)
All checks were successful
Sanity Checks / sanity-test (pull_request) Successful in 16s
Smoke Test / smoke (pull_request) Successful in 19s
b4c4919361
Timmy approved these changes 2026-04-15 04:13:42 +00:00
Timmy left a comment
Owner

Fix looks reasonable.

Scope: 2 file(s) changed (92+ / 2-)

Fix looks reasonable. **Scope**: 2 file(s) changed (92+ / 2-)
Author
Owner

Superseded by PR #116, which includes all changes from this PR plus:

  • Focus recovery when focus escapes the overlay (critical for screen reader users)
  • Additional regression test for focus recovery

PR #116: #116

Superseded by PR #116, which includes all changes from this PR plus: - Focus recovery when focus escapes the overlay (critical for screen reader users) - Additional regression test for focus recovery PR #116: https://forge.alexanderwhitestone.com/Timmy_Foundation/the-door/pulls/116
Rockachopa closed this pull request 2026-04-15 04:38:46 +00:00
All checks were successful
Sanity Checks / sanity-test (pull_request) Successful in 16s
Smoke Test / smoke (pull_request) Successful in 19s

Pull request closed

Sign in to join this conversation.