Skip to content

feat(web): enforce keyboard focus trapping in custom modals(closes #2090)#2144

Merged
dipexplorer merged 1 commit into
RatLoopz:mainfrom
shauryavardhan1307:fix/issue-2090-modal-focus-trap
Jun 20, 2026
Merged

feat(web): enforce keyboard focus trapping in custom modals(closes #2090)#2144
dipexplorer merged 1 commit into
RatLoopz:mainfrom
shauryavardhan1307:fix/issue-2090-modal-focus-trap

Conversation

@shauryavardhan1307

Copy link
Copy Markdown
Contributor

🛑 STOP: Assignment & File Scope Check

  • I am assigned to this issue.
  • I verified that this PR ONLY touches the required files.

Warning

PRs with unrelated files will not be reviewed and may be closed.

📋 PR Summary & Link

  • Closes [Accessibility] Enforce Focus Trap in custom Modals #2090
  • Summary: Implemented keyboard focus trapping inside custom modals (ExpiryModal and ExportModal) to meet WCAG accessibility standards for dialogs. Added a reusable custom React hook useFocusTrap to handle focus cycle and restoration without external package dependencies.

📸 Proof of Work (Screenshots / Logs)

Important

No Pull Request will be merged without proof of testing!

  • Frontend/UI changes: You MUST attach screenshots or screen recordings (GIFs/Videos) showing the UI changes.

Note: This is an accessibility behavior change for keyboard navigation (focus trapping/restoration) with no visual UI style changes. Programmatic verification logs are attached below:

Unit Test Execution Logs

PASS tests/useFocusTrap.test.tsx
  useFocusTrap
    √ automatically focuses the first focusable element inside the ref container on mount when enabled (50 ms)
    √ traps Tab key so that pressing Tab on the last element wraps focus back to the first (13 ms)
    √ traps Shift+Tab key so that pressing Shift+Tab on the first element wraps focus to the last (7 ms)
    √ restores focus to the previously focused element when unmounted (6 ms)

Test Suites: 1 passed, 1 total
Tests:       4 passed, 4 total
Snapshots:   0 total
Time:        1.562 s
Ran all test suites matching tests/useFocusTrap.test.tsx.

🏷️ PR Type

  • 🐛 type: bug
  • type: feature
  • 📖 type: docs
  • 🧪 type: testing
  • 🔒 type: security
  • type: performance
  • 🎨 type: design
  • ♻️ type: refactor
  • 🛠️ type: devops
  • type: accessibility

✅ Checklist

  • My PR has a linked issue (Closes #2090)
  • I have pulled the latest main and resolved any conflicts

Copilot AI review requested due to automatic review settings June 20, 2026 06:15
@github-project-automation github-project-automation Bot moved this to 📥 Backlog in SahiDawa Workflow Jun 20, 2026
@github-actions github-actions Bot added gssoc:approved Approved for gssoc level:advanced 55 pts status: open-for-all type:accessibility Accessibility improvements (ARIA, WCAG) labels Jun 20, 2026

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@dipexplorer dipexplorer added level:intermediate 35 pts type:feature New feature or request labels Jun 20, 2026
@dipexplorer dipexplorer merged commit 2acbbae into RatLoopz:main Jun 20, 2026
19 of 21 checks passed
@github-project-automation github-project-automation Bot moved this from 📥 Backlog to 🎉 Merged in SahiDawa Workflow Jun 20, 2026
@github-actions

Copy link
Copy Markdown
Contributor

🎉 Congratulations @shauryavardhan1307! Your Pull Request "feat(web): enforce keyboard focus trapping in custom modals(closes #2090)" has been successfully merged by @dipexplorer.

Thank you for your valuable contribution to SahiDawa! 🇮🇳
If this was for GSSoC 2026, your work is officially merged and valid. Keep up the great work and feel free to claim other open issues. 🚀

Follow us on LinkedIn: https://www.linkedin.com/company/ratloopz/ to get shoutout

@dipexplorer dipexplorer added quality:exceptional multiplier x1.5 shoutout:approved Approved by admin for LinkedIn Shoutout labels Jun 21, 2026
@github-actions

Copy link
Copy Markdown
Contributor

👋 Your PR is approved for a LinkedIn shoutout!
To get featured, please add your LinkedIn ID to your GitHub profile social links, or to the PR description like this:
LinkedIn: https://linkedin.com/in/your-username

Follow our page to ensure you get properly tagged: https://www.linkedin.com/company/ratloopz/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

gssoc:approved Approved for gssoc level:advanced 55 pts quality:exceptional multiplier x1.5 shoutout:approved Approved by admin for LinkedIn Shoutout status: open-for-all type:accessibility Accessibility improvements (ARIA, WCAG) type:feature New feature or request

Projects

Status: 🎉 Merged

Development

Successfully merging this pull request may close these issues.

[Accessibility] Enforce Focus Trap in custom Modals

3 participants