fix(#69): crisis overlay initial focus targets enabled element #90

Closed
Rockachopa wants to merge 1 commits from burn/69-1776218206 into main
Owner

Closes #69.

Problem

When crisis overlay opens, showOverlay():

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

Disabled buttons can't 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

File Change
index.html Focus .overlay-call link on open, fallback to dismiss button
tests/test_crisis_overlay_focus_trap.py New test: test_overlay_initial_focus_targets_enabled_element

Tests

4 tests passing (all in test_crisis_overlay_focus_trap.py)

Closes #69

Closes #69. ## Problem When crisis overlay opens, `showOverlay()`: 1. Disables the dismiss button (`overlayDismissBtn.disabled = true`) 2. Calls `overlayDismissBtn.focus()` Disabled buttons can't 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 | File | Change | |------|--------| | index.html | Focus `.overlay-call` link on open, fallback to dismiss button | | tests/test_crisis_overlay_focus_trap.py | New test: `test_overlay_initial_focus_targets_enabled_element` | ## Tests 4 tests passing (all in `test_crisis_overlay_focus_trap.py`) Closes #69
Rockachopa added 1 commit 2026-04-15 02:18:43 +00:00
fix(#69): crisis overlay initial focus targets enabled element
All checks were successful
Sanity Checks / sanity-test (pull_request) Successful in 10s
Smoke Test / smoke (pull_request) Successful in 16s
c058701b84
Problem: showOverlay() disabled the dismiss button then called
overlayDismissBtn.focus(). Disabled buttons can't receive focus,
so the overlay opened without a valid keyboard focus target.

Fix: Focus the Call 988 link (.overlay-call) instead — it's always
enabled and is the most important action in the crisis overlay.

Changes:
- index.html: Focus .overlay-call link on overlay open
- tests/test_crisis_overlay_focus_trap.py: New test for initial focus

Refs #69
Author
Owner

Fix submitted: PR #107

Changed showOverlay() to focus .overlay-call link instead of disabled dismiss button. Added 2 new tests.

Fix submitted: PR #107 Changed `showOverlay()` to focus `.overlay-call` link instead of disabled dismiss button. Added 2 new tests.
Author
Owner

Closing: superseded by PR #107 which has a cleaner implementation.

Closing: superseded by PR #107 which has a cleaner implementation.
Rockachopa closed this pull request 2026-04-15 04:00:31 +00:00
All checks were successful
Sanity Checks / sanity-test (pull_request) Successful in 10s
Smoke Test / smoke (pull_request) Successful in 16s

Pull request closed

Sign in to join this conversation.