fix(test): support jsdom 30.1 in Radix menu/select tests (PP-nzbe) - #2334
Merged
Merged
Conversation
… (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>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Owner
Author
Claude Code review (low)Reviewed head —Claude |
This branch was successfully deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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
windowblurevent (and thefocusoutrelatedTargetis 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 likerole="menuitem"/role="option"fail (14 files on Dependabot #2324, run 36954089624).jsdom 30.1.1 fixes it upstream ("Fixed spurious window
blurandfocusoutevents and incorrectevent.relatedTargetvalues when focusing an element after removing the previously focused element, which regressed in v30.1.0").Minimal repro (focus
a, removea, focusc):focusout rel=cwindow-blur(spurious)Fix
Bump
jsdomto^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 insrc/test/setup.tswould only mask a fixed upstream bug.Verification
SettingsTabDirty,RouteTabStrip,user-menu-clientfail (8 tests), matching CI.pnpm run testpasses (2971 tests);pnpm run checkclean.Follow-up
The jsdom 30.1 minor is currently ignored on Dependabot via a comment command on #2324. Once this merges, comment
@dependabot unignore jsdomon a Dependabot PR so future jsdom updates flow again.🤖 Generated with Claude Code