fix(deps): dedupe radix focus-scope/dismissable-layer so in-modal dropdowns open#4977
Conversation
…pdowns open @radix-ui/react-dropdown-menu was the only Radix package pinned exactly (2.1.16), so the v0.7.0 lockfile refresh left its react-menu on focus-scope@1.1.7 + dismissable-layer@1.1.11 while react-dialog@1.1.16 moved to focus-scope@1.1.9 + dismissable-layer@1.1.12. These packages coordinate modal/popper interplay through module-scoped singletons (focusScopesStack, layersWithOutsidePointerEventsDisabled); with two copies in the bundle, a dialog's focus trap never pauses for a menu portaled outside it and yanks focus back as the menu opens, so the menu's dismiss layer unmounts it in the same tick. Symptom: ChipDropdown menus inside ChipModal (e.g. the credential Add People role dropdown) never appear in fresh-install/production builds while stale local installs with a single shared copy keep working. Bump dropdown-menu to 2.1.17, whose react-menu pins the same internals batch as dialog 1.1.16 — every coordination package (dismissable-layer, focus-scope, focus-guards, portal, popper, presence) now resolves to a single version tree-wide.
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
PR SummaryLow Risk Overview That dedupes the focus/dismiss coordination singletons that were split across two versions after a prior lockfile refresh. Dropdowns inside modals (e.g. credential “Add people” role) were opening and closing in the same tick in production because the menu registered on the wrong focus stack; this dependency alignment is the fix. No application source changes. Reviewed by Cursor Bugbot for commit b746787. Configure here. |
Greptile SummaryFixes a production-only bug where in-modal dropdowns (e.g. the credential "Add people" role dropdown) never rendered because the bundle contained two copies of Radix's
Confidence Score: 5/5Safe to merge — a minimal, well-diagnosed dependency bump that resolves a confirmed production regression with no application code changes. The change is a single version bump in package.json plus the resulting lockfile deduplication. The root cause (duplicate coordination singletons from a mismatched exact pin) is clearly documented, the fix is targeted and verified, and the lockfile confirms all shared Radix internals now resolve to one copy. No application code is touched. No files require special attention. Important Files Changed
Flowchart%%{init: {'theme': 'neutral'}}%%
flowchart TD
subgraph Before["Before (broken — two singleton copies)"]
RD["react-dialog@1.1.16"]
RM16["react-menu@2.1.16"]
FS_new["focus-scope@1.1.9 (dialog's copy)"]
DL_new["dismissable-layer@1.1.12 (dialog's copy)"]
FS_old["focus-scope@1.1.7 (menu's private copy)"]
DL_old["dismissable-layer@1.1.11 (menu's private copy)"]
RD --> FS_new
RD --> DL_new
RM16 --> FS_old
RM16 --> DL_old
FS_new -. "different module instance" .-> FS_old
BUG["❌ focusScopesStack mismatch → menu unmounts immediately"]
FS_old --> BUG
end
subgraph After["After (fixed — single shared copy)"]
RD2["react-dialog@1.1.16"]
RM17["react-menu@2.1.17"]
FS_shared["focus-scope@1.1.9 (shared)"]
DL_shared["dismissable-layer@1.1.12 (shared)"]
RD2 --> FS_shared
RD2 --> DL_shared
RM17 --> FS_shared
RM17 --> DL_shared
OK["✅ Shared singleton → focus trap pauses correctly → dropdown opens"]
FS_shared --> OK
end
Reviews (2): Last reviewed commit: "fix(deps): use caret range for dropdown-..." | Re-trigger Greptile |
… the same batch Address review: the exact pin was the original divergence mechanism, and the rest of the radix popper/dialog family floats on caret ranges that jump to the same internals batch together on lockfile refreshes.
|
@greptile |
|
@cursor review |
There was a problem hiding this comment.
✅ Bugbot reviewed your changes and found no new issues!
Comment @cursor review or bugbot run to trigger another review on this PR
Reviewed by Cursor Bugbot for commit b746787. Configure here.
Summary
@radix-ui/react-dropdown-menuwas the only Radix package pinned exactly (2.1.16), so when the lockfile refreshed in improvement(mothership): v0.2 #4923,react-dialogmoved tofocus-scope@1.1.9+dismissable-layer@1.1.12whilereact-menustayed on1.1.7/1.1.11focusScopesStack, so the dialog's focus trap never pauses, yanks focus back as the menu opens, and the menu's dismiss layer unmounts it in the same tick — the dropdown never appears. Stale local installs (single shared copy viareact-dialog@1.1.15) keep working, which is why this only reproduced on fresh-install/production buildsChipDropdownwas already on the popover layer — z-index was never the cause@radix-ui/react-dropdown-menuto2.1.17, whosereact-menupins the same internals batch asreact-dialog@1.1.16. Verified every coordination package (dismissable-layer, focus-scope, focus-guards, portal, popper, presence) now resolves to a single version tree-wideType of Change
Testing
bun installthat the duplicatedismissable-layer/focus-scopecopies existed before and resolve to single versions afterdialog@1.1.16+dropdown-menu@2.1.16(the shipped pair) the menu fires open→close in the same tick and never renders; withdropdown-menu@2.1.17it opens, items select, and it closes cleanlyChecklist