fix: patch headlessui Frozen and useInertOthers to restore dropdown positioning and interactivity - #9751
Conversation
Combobox.Options (and other headlessui overlays) wrap their children in
the internal Frozen component, which does cloneElement(child, { ref }).
Since no ref is forwarded to Frozen, that config ref is null and it
overrides the child's own ref, so ref={setPopperElement} on popper
content never fires. With popperElement stuck at null, react-popper
never creates an instance and dropdowns stay at their initial
left:0/top:0 position (top-left corner of the page) on React 19.
Patch Frozen to return the child untouched when no ref is forwarded.
This restores popper positioning for all headlessui-based dropdowns
(date, state, member, module, cycle, priority, etc.).
…tive Combobox.Options (modal by default) marks every element that does not contain an allowed element (input/button/options) as inert. Because the dropdowns render Combobox.Input inside the portaled Combobox.Options and wrap the options in a scrollable div, that wrapper got inert + aria-hidden, making all options unclickable (upstream: tailwindlabs/headlessui#3421). Extend the existing pnpm patch so useInertOthers also skips descendants of allowed elements (with a null guard for not-yet-registered refs).
◈ PR Lens
Architecture 1 component touched across 1 lane. Data flow No data-flow sequence changed in this PR. Drill down
|
|
|
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Team Run ID: ⛔ Files ignored due to path filters (1)
📒 Files selected for processing (2)
Included review availability: Your plan provides up to 10 included reviews per hour; 9 remain after this review. 📝 WalkthroughWalkthroughThe workspace configuration registers a pnpm patch for ChangesHeadless UI patch
Estimated code review effort: 1 (Trivial) | ~2 minutes Merge Risk: ⚪ Minimal · up to The dependency patch registration enables the intended dropdown fixes with no identified current merge-blocking risk. Suggested reviewers: 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 inconclusive)
✅ Passed checks (4 passed)
Full details: Linked Issues checkExplanation The description addresses both requirements from issue Resolution Provide the patch file or a raw summary of its changes so the Frozen ref-preservation fix and useInertOthers descendant-handling fix can be verified against issue Full details: Docstring CoverageExplanation No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff. Analyzed 0 functions across 0 files. (1 skipped: 1 unsupported.) ✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Description
Fixes headlessui-based dropdowns (state, priority, member, module, cycle, date, etc.) being broken on
previewafter the React 19 upgrade (#9530, headlessui v1 → v2.2.10):left:0/top:0) — headlessui's internalFrozencomponent doescloneElement(child, { ref })with anullconfig ref when no ref is forwarded, clobbering the child's own ref.ref={setPopperElement}therefore never fires,popperElementstaysnull, andreact-poppernever creates an instance.useInertOthersmarks every element not containing an allowed element as inert. Since these dropdowns renderCombobox.Inputinside the portaledCombobox.Optionsand wrap options in a scrollable div, that wrapper getsinert+aria-hidden(upstream: Inert is over extending into elements inside the combo box tailwindlabs/headlessui#3421).The fix extends the pnpm patch mechanism already used for
react-color:Frozento return the child untouched when no ref is forwarded, restoring popper positioning for all headlessui-based dropdowns.useInertOthersto also skip descendants of allowed elements (with a null guard for not-yet-registered refs), keeping the options subtree interactive.Type of Change
Test Scenarios
inert/aria-hidden).pnpm install --frozen-lockfilepasses with the newpatch_hashentries.References
Closes #9750
Summary by CodeRabbit