Summary
Dialog doesn't return focus to trigger button when closed - users lose their place.
Severity: P1 (High)
WCAG: 2.4.3 Focus Order (Level A)
Component: Dialog
File: src/components/dialog/dialog.tsx:104-110
Issue
After closing dialog, focus doesn't return to the button that opened it. Keyboard users must Tab from page start.
User Impact: "I opened a dialog, made changes, closed it. Now I'm back at the top of the page and have to Tab through 50 elements to get back to where I was."
Fix (1 hour)
const triggerRef = useRef<HTMLElement | null>(null);
const handleOpen = () => {
triggerRef.current = document.activeElement as HTMLElement;
setOpenState(true);
};
const handleClose = () => {
setOpenState(false);
// Return focus after animation
setTimeout(() => {
if (triggerRef.current) {
triggerRef.current.focus();
}
}, 300);
};
Testing
Related: #369, #371, #375
Priority: P1
Summary
Dialog doesn't return focus to trigger button when closed - users lose their place.
Severity: P1 (High)
WCAG: 2.4.3 Focus Order (Level A)
Component: Dialog
File: src/components/dialog/dialog.tsx:104-110
Issue
After closing dialog, focus doesn't return to the button that opened it. Keyboard users must Tab from page start.
User Impact: "I opened a dialog, made changes, closed it. Now I'm back at the top of the page and have to Tab through 50 elements to get back to where I was."
Fix (1 hour)
Testing
Related: #369, #371, #375
Priority: P1