You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Bug: Dialogs and the command palette do not return focus to their trigger on close (focus falls to <body>) — WCAG 2.4.3 #1988
Programmatically-opened overlays do not restore keyboard focus to the control that opened them; on close (Escape or the X button) document.activeElement becomes <body>. A keyboard/screen-reader user is dumped at the top of the page and loses their place. Reproduced across the change-password dialog, the governance DSAR & legal-hold dialogs, the chat Export & Share dialogs, and the Cmd/Ctrl+K command palette (each 2/2 runs).
Steps to reproduce
Open any of: Account → Change password; Governance → File erasure request / Place legal hold; chat header → Export / Share; Cmd/Ctrl+K palette.
Close via Escape or the X.
document.activeElement is <body>, not the trigger.
Expected behavior
On close, focus returns to the control that opened the overlay (Radix Dialog does this when given a DialogTrigger).
Affected service
Platform (web app)
Version or commit
cd13268b8
Browser and OS
Headless Chrome (Playwright) on macOS
Relevant log output / evidence
Live page.evaluate readbacks: change-password, DSAR, legal-hold, export, share, palette all return {tag:'BODY'} after close (focus WAS correctly trapped while open).
Root cause. These overlays are opened programmatically via useState without the shared Dialog's trigger prop (services/platform/app/components/ui/dialog/dialog.tsx — onCloseAutoFocus is only handled when preventCloseAutoFocus is set), so Radix has no trigger to restore to. The command palette (packages/ui/src/components/search/search-command.tsx) has the same gap.
Fix. Capture the previously-focused element on open and refocus it on close (or pass a real trigger / set onCloseAutoFocus to refocus the opener) in the Dialog primitive and SearchCommand.
Filed by an automated deep manual-QA sweep (wave 2) on a local hermetic stack (commit cd13268b8, mode-A mock LLM, headless Chrome). Reproduced before filing.
Activity
fix: dialogs and command palette restore focus to trigger on close (#…