Skip to content

Add focus-return tests for Modal and Drawer primitives #350

Description

@Abidoyesimze

Summary

Keyboard users should return to the triggering control after closing overlays.

Affected files

  • src/components/ui/Modal.tsx
  • src/components/ui/Drawer.tsx
  • src/hooks/useFocusTrap.ts

Tasks

  • Verify focus trap and restore behavior in Modal and Drawer.
  • Add tests covering open → close focus return.
  • Fix any regressions in useFocusTrap.

Acceptance criteria

  • Scope is limited to the files listed (or agreed alternatives in the PR).
  • Change is verifiable: tests, screenshots, or written QA steps in the PR.
  • No behavior regressions in related user flows.
  • No new duplicate abstractions without a one-line rationale in the PR.

Suggested labels

cleanup, a11y, testing

Notes

Standalone cleanup issue from CLEANUP_ISSUES_2026-05.md. Complements the audit queue and product backlog.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions