Skip to content

Add new focus trap controller#1198

Merged
brentswisher merged 6 commits intodevelopfrom
feat/update-focus-trap-library
Mar 25, 2026
Merged

Add new focus trap controller#1198
brentswisher merged 6 commits intodevelopfrom
feat/update-focus-trap-library

Conversation

@brentswisher
Copy link
Copy Markdown
Contributor

@brentswisher brentswisher commented Feb 20, 2026

This change: (check at least one)

  • Adds a new feature
  • Fixes a bug
  • Improves maintainability
  • Improves documentation
  • Is a release activity

Is this a breaking change? (check one)

  • Yes
  • No

Is the: (complete all)

  • Title of this pull request clear, concise, and indicative of the issue number it addresses, if any?
  • Test suite(s) passing?
  • Code coverage maximal?
  • Changeset added?

What does this change address?
Closes #777

How does this change work?
This replaces the previous focus-trap implementation, with a new focus trap controller that uses the more actively maintained https://github.com/focus-trap/focus-trap library. It allows us to remove the previous implementation that relied on a forked package we are struggling to keep maintained.

Additional context

@brentswisher brentswisher self-assigned this Feb 20, 2026
@changeset-bot
Copy link
Copy Markdown

changeset-bot Bot commented Feb 20, 2026

⚠️ No Changeset found

Latest commit: d8d67c3

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Feb 20, 2026

size-limit report 📦

Path Size
packages/pharos/lib/index.js 1.05 MB (+0.47% 🔺)

Comment thread packages/pharos/src/components/dropdown-menu/pharos-dropdown-menu.ts Outdated
@brentswisher brentswisher force-pushed the feat/update-focus-trap-library branch from a386e05 to 9c44f6a Compare March 9, 2026 12:42
@brentswisher brentswisher force-pushed the feat/update-focus-trap-library branch from 6f20eed to eb8c2b4 Compare March 20, 2026 14:47
@brentswisher brentswisher marked this pull request as ready for review March 20, 2026 14:56
@brentswisher brentswisher requested a review from a team as a code owner March 20, 2026 14:56
@brentswisher brentswisher requested review from jialin-he, mtorres3 and satya-achanta-venkata and removed request for a team March 20, 2026 14:56
Comment thread packages/pharos/src/components/modal/pharos-modal.ts
@brentswisher brentswisher requested a review from sirrah-tam March 23, 2026 12:03
Copy link
Copy Markdown
Contributor

@sirrah-tam sirrah-tam left a comment

Choose a reason for hiding this comment

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

Tested with MacOS & VoiceOver (Chrome & Safari), Windows & NVDA/JAWS (Chromium Edge). Everything works as expected.

This replaces the previous focus-trap implementation.
This allows us to remove the previous implementation
that relied on a forked package we are struggling to keep
maintained.
The new focus trap library focuses the first element by default when
the trap is activated. This is not ideal for dropdowns, which should
only focus the first element if the user has navigated to the
dropdown using the keyboard.
@brentswisher brentswisher force-pushed the feat/update-focus-trap-library branch from eca9a2d to d8d67c3 Compare March 25, 2026 12:27
@brentswisher brentswisher merged commit a42ee74 into develop Mar 25, 2026
11 checks passed
@brentswisher brentswisher deleted the feat/update-focus-trap-library branch March 25, 2026 12:40
@brentswisher brentswisher mentioned this pull request Apr 2, 2026
11 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Update to actively supported focus-trap library

3 participants