Skip to content

fix(test): support jsdom 30.1 in Radix menu/select tests (PP-nzbe) - #2334

Merged
timothyfroehlich merged 1 commit into
mainfrom
fix/PP-nzbe-jsdom-30-1
Oct 2, 2026
Merged

timothyfroehlich merged 1 commit into
mainfrom
fix/PP-nzbe-jsdom-30-1

Conversation

@timothyfroehlich

Copy link
Copy Markdown
Owner

Root cause

jsdom 30.1.0 regressed focus handling: when focus moves to an element after the previously focused element has been removed from the DOM, jsdom fires a spurious window blur event (and the focusout relatedTarget is wrong). Radix Select and DropdownMenu close their content on window blur / focus-outside, so in RTL tests the menu or listbox opens and immediately closes, and lookups like role="menuitem" / role="option" fail (14 files on Dependabot #2324, run 36954089624).

jsdom 30.1.1 fixes it upstream ("Fixed spurious window blur and focusout events and incorrect event.relatedTarget values when focusing an element after removing the previously focused element, which regressed in v30.1.0").

Minimal repro (focus a, remove a, focus c):

jsdom events
30.0.1 focusout rel=c
30.1.0 window-blur (spurious)
30.1.1 none

Fix

Bump jsdom to ^30.1.1 (skips the broken 30.1.0). No shared-setup polyfill or per-test change is needed; working around 30.1.0's bug in src/test/setup.ts would only mask a fixed upstream bug.

Verification

  • 30.1.0 pinned: SettingsTabDirty, RouteTabStrip, user-menu-client fail (8 tests), matching CI.
  • 30.1.1: full unit suite pnpm run test passes (2971 tests); pnpm run check clean.

Follow-up

The jsdom 30.1 minor is currently ignored on Dependabot via a comment command on #2324. Once this merges, comment @dependabot unignore jsdom on a Dependabot PR so future jsdom updates flow again.

🤖 Generated with Claude Code

… (PP-nzbe)

jsdom 30.1.0 fires a spurious window `blur` (and drops the `focusout`
relatedTarget) when focus moves to a new element after the previously
focused element was removed. Radix Select and DropdownMenu close on that
blur, so their content never stays open in unit tests. jsdom 30.1.1 fixes
the regression upstream; skipping 30.1.0 needs no test-setup workaround.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@vercel

vercel Bot commented Oct 2, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
pin-point Ready Ready Preview Oct 2, 2026 9:15pm UTC

Request Review

@timothyfroehlich

Copy link
Copy Markdown
Owner Author

Claude Code review (low)

Reviewed head 3c691dc with /code-review low. No findings.

—Claude

@timothyfroehlich
timothyfroehlich marked this pull request as ready for review October 2, 2026 21:31
@timothyfroehlich
timothyfroehlich merged commit e072de1 into main Oct 2, 2026
17 checks passed
@timothyfroehlich
timothyfroehlich deleted the fix/PP-nzbe-jsdom-30-1 branch October 2, 2026 21:53

This branch was successfully deployed

1 active deployment
Preview — 3c691dcd Deployed Oct 2, 2026 by vercel[bot]
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.

1 participant