Skip to content

fix: restore dropdown positioning after Headless UI v2 upgrade - #9791

Draft
codingwolf-at wants to merge 5 commits into
previewfrom
fix/dropdowns-after-react-upgrade
Draft

fix: restore dropdown positioning after Headless UI v2 upgrade#9791
codingwolf-at wants to merge 5 commits into
previewfrom
fix/dropdowns-after-react-upgrade

Conversation

@codingwolf-at

@codingwolf-at codingwolf-at commented Sep 8, 2026

Copy link
Copy Markdown
Contributor

Description

Headless UI v2 (Frozen + default modal={true} Combobox) broke dropdowns after the React 19 upgrade: menus opened at the viewport origin, option clicks did nothing, peek closed on select, and portaled date pickers sat behind peek.

This keeps public Headless APIs only (no vendor patch) and:

  • Puts popper ref / style / attributes on the Options/Items/Panel host so Frozen cloneElement cannot clobber the popper node
  • Uses strategy: "fixed" and modal={false} on searchable / in-peek lists
  • Puts z-30 (and data-prevent-outside-click where needed) on portaled hosts
  • Uses composedPath() in peek/sidebar/outside-click hooks so a detached mousedown after Headless v2 select is not treated as an outside click

Type of Change

  • Bug fix (non-breaking change which fixes an issue)

Screenshots and Media (if applicable)

This section covers only a subset of the affected dropdowns. There are many instances across web, space, onboarding, modals, and settings, so the table below is a representative sample rather than a full inventory.

Surface Result Screenshot
State dropdown (browse) PASS state-dropdown--browse-test-1--open
Due date calendar (browse) PASS date-dropdown--browse-test-1--due-date-open
Peek state dropdown PASS state-dropdown--peek-test-1--open
Display filters PASS display-dropdown--issues-list--open
DateDropdown PASS date-dropdown--harness--open
DateRangeDropdown PASS date-range-dropdown--harness--open
PriorityDropdown PASS priority-dropdown--harness--open
StateDropdown PASS state-dropdown--harness--open
IntakeStateDropdown PASS intake-state-dropdown--harness--open
MemberDropdown PASS member-dropdown--harness--open

Test Scenarios

  • Open state / priority / assignees on a full work item page: menu is next to the trigger, search works, selecting an option updates the property.
  • Open start / due date on the same page: calendar is position: fixed and visible (not behind the panel).
  • From the project work-item list, open peek, change state/priority: peek stays open.
  • Open Display on the work-item list: panel is anchored to Display, not the viewport origin.
  • Confirm no leftover ref={setPopperElement} on a Frozen inner div.

References

…ponents

- Changed popperElement state type from HTMLDivElement to HTMLElement for better compatibility.
- Set popper strategy to "fixed" in various dropdown components to enhance positioning behavior.
- Updated Combobox.Options to include modal={false} where applicable for consistent dropdown behavior.
@coderabbitai

coderabbitai Bot commented Sep 8, 2026

Copy link
Copy Markdown
Contributor

Important

Draft PR not reviewed

Draft PRs are not automatically reviewed by default.

  • Trigger a manual review

To automatically review draft PRs, update your CodeRabbit configuration:

reviews:
  auto_review:
    drafts: true

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@github-actions

github-actions Bot commented Sep 8, 2026

Copy link
Copy Markdown

React Doctor found 23 new issues in 13 files · 23 warnings · score 77 / 100 (Needs work) · 10 fixed · vs preview

23 warnings

core/components/dropdowns/date-range.tsx

  • ⚠️ L72 React function has high control-flow complexity no-high-complexity-react-function
  • ⚠️ L291 Interaction on static element no-static-element-interactions

core/components/dropdowns/date.tsx

  • ⚠️ L168 Interaction on static element no-static-element-interactions

core/components/dropdowns/estimate.tsx

  • ⚠️ L48 React function has high control-flow complexity no-high-complexity-react-function
  • ⚠️ L219 Interaction on static element no-static-element-interactions

core/components/dropdowns/intake-state/base.tsx

  • ⚠️ L48 React function has high control-flow complexity no-high-complexity-react-function
  • ⚠️ L204 Duplicated JSX structure duplicate-jsx-subtree

core/components/dropdowns/project/base.tsx

  • ⚠️ L224 Interaction on static element no-static-element-interactions

core/components/dropdowns/state/base.tsx

  • ⚠️ L48 React function has high control-flow complexity no-high-complexity-react-function

core/components/issues/issue-detail/label/select/label-select.tsx

  • ⚠️ L34 React function has high control-flow complexity no-high-complexity-react-function
  • ⚠️ L198 Click handler missing keyboard handler click-events-have-key-events
  • ⚠️ L198 Handler on non-interactive element no-noninteractive-element-interactions

core/components/issues/issue-layouts/properties/label-dropdown.tsx

  • ⚠️ L48 React function has high control-flow complexity no-high-complexity-react-function

core/components/issues/select/base.tsx

  • ⚠️ L41 React function has high control-flow complexity no-high-complexity-react-function
  • ⚠️ L154 Interaction on static element no-static-element-interactions

core/components/onboarding/invite-members.tsx

  • ⚠️ L179 Duplicated JSX structure duplicate-jsx-subtree

src/dropdown/single-select.tsx

  • ⚠️ L118 Interaction on static element no-static-element-interactions

src/dropdowns/custom-search-select.tsx

  • ⚠️ L89 Interaction on static element no-static-element-interactions
  • ⚠️ L185 Click handler missing keyboard handler click-events-have-key-events
  • ⚠️ L185 Handler on non-interactive element no-noninteractive-element-interactions

src/dropdowns/custom-select.tsx

  • ⚠️ L71 Interaction on static element no-static-element-interactions
  • ⚠️ L171 Click handler missing keyboard handler click-events-have-key-events
  • ⚠️ L171 Handler on non-interactive element no-noninteractive-element-interactions

Reviewed by React Doctor for commit 5adc791. See inline comments for fixes.

@codingwolf-at codingwolf-at self-assigned this Sep 8, 2026
- Added className="z-30" to Popover.Panel in multiple components to improve stacking context.
- Set popper strategy to "fixed" in the Popover component for better positioning behavior.
- Updated modal={false} in Listbox.Options for consistent dropdown behavior across the application.
@codingwolf-at codingwolf-at changed the title refactor: update popper element type and strategy across dropdown com… [WIP] fix: restore dropdown positioning after Headless UI v2 upgrade Sep 8, 2026
- Updated the outside click detection logic in use-extended-sidebar-overview-outside-click, use-peek-overview-outside-click, and use-outside-click-detector hooks to utilize event.composedPath() for improved accuracy.
- Simplified checks for elements with data attributes to enhance readability and maintainability of the code.
- Removed redundant checks and streamlined the callback invocation process for better performance.
- Modified the outside click detection logic in use-extended-sidebar-overview-outside-click and use-peek-overview-outside-click hooks to check for Node type instead of HTMLElement. This change enhances compatibility with event handling and improves the accuracy of click detection.
- Removed unnecessary type casting for the popper element reference in the GptAssistantPopover component, enhancing code clarity and maintainability.
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