Files
sure/app/components/DS
Guillem Arias fbcd13c44d fix(a11y): focus trap + returnFocus on DS::Dialog
Native <dialog>.showModal() moves focus inside the dialog on open but
doesn't trap Tab / Shift+Tab, and focus restoration on close is
inconsistent across engines. Add three things to the dialog controller:

- Capture document.activeElement before showModal() so the trigger is
  recoverable when the dialog closes (ESC, backdrop click, explicit
  close button, programmatic close all route through the native close
  event).
- Wrap Tab inside the dialog so a keyboard user can't tab out into the
  scrim-covered page behind.
- Restore focus to the captured trigger on the close event. If the
  trigger has been detached (Turbo morphed it out), skip silently
  rather than throw.

Verified manually: opening the new-goal modal moves focus to the name
input; ESC restores focus to the "New goal" link; Tab wraps from the
last focusable back to the first.
2026-05-18 21:06:47 +02:00
..
2025-07-18 08:30:00 -04:00
2025-07-18 08:30:00 -04:00
2025-07-18 08:30:00 -04:00
2025-07-18 08:30:00 -04:00
2025-07-18 08:30:00 -04:00
2025-07-18 08:30:00 -04:00
2025-07-18 08:30:00 -04:00
2025-07-18 08:30:00 -04:00
2025-07-18 08:30:00 -04:00
2025-07-18 08:30:00 -04:00