Skip to content

[bug]: Dropdown options unselectable on React 19 — react-popper panel never positions when building web from source #9857

Open

Description

@yuzhiyang1

Current Behavior

When the web app is built from source (v1.4.2, React 19.2.8), dropdown panels open but options cannot be selected. Affected dropdowns include state, priority, member, cycle, module, estimate, project and intake — e.g. in the "create work item" modal, clicking any option in the state dropdown does nothing.

Steps to Reproduce

  1. Build web from source using apps/web/Dockerfile.web (turbo prune → pnpm turbo run build --filter=web).
  2. Open the web app, create/open any work item modal.
  3. Open the state (or priority/cycle/module/member) dropdown.
  4. Click any option — nothing happens. No network request, no console error.

Root Cause

react-popper@2.3.0 receives the trigger button and panel DOM through callback refs (ref={setReferenceElement} / ref={setPopperElement} wired to useState setters). Under React 19, a disrupted render can drop those callback invocations, leaving the state null forever. usePopper's layout effect then returns early on its null guard, createPopper never runs (the panel has no data-popper-placement attribute), Combobox.Options stays at 0x0, and headlessui classifies every option click as an outside click.

Evidence collected from a live repro (React fiber inspection): referenceElement resolves to the button, popperElement stays null, styles.popper remains {position:'absolute',left:'0',top:'0'}, zero requests on click. Manually applying the expected fixed positioning to the panel makes option clicks work immediately.

Note: pnpm-workspace.yaml already documents that react-popper 2.3.0 was accepted on React 19 ("only uses hooks — runs unchanged"). That analysis holds for the happy path, but not for ref callbacks dropped across render interruptions.

Environment

  • Self-hosted, built from source @ v1.4.2 (makeplane/plane master)
  • react 19.2.8, react-popper 2.3.0, @headlessui/react 2.2.10

Suggested Fix

Add DOM-recovery effects next to each usePopper call: when the ref state is null while the dropdown is open, locate the mounted trigger button / currently open panel (ul[data-headlessui-state="open"]) and feed it back into popper. A PR with this recovery for the affected dropdown components follows. Long-term, migrating off the archived react-popper to @floating-ui/react would remove the whole class of issues.

Activity

  1. VishakhaSahu05 commented on Oct 3, 2026

    @VishakhaSahu05

    Hi! I'd like to work on this issue. I was able to understand the reported React 19 + react-popper ref handling problem, and I'd like to investigate the affected dropdown components and add a regression test/fix. Please let me know if I can take this up.

  2. GaafarBBK commented on Oct 26, 2026

    @GaafarBBK

    We hit this on a self-hosted build (React 19.2.8, @headlessui/react 2.2.10, react-popper 2.3.0) and traced it to Headless UI. It doesn't come from React dropping ref callbacks on interrupted renders: it is deterministic and happens on every open.

    Root cause

    ComboboxOptions wraps its children in an internal <Frozen> component (src/internal/frozen.tsx) and renders it without a ref. Frozen then does:

    if (isValidElement(contents)) {
      return cloneElement(contents, { ref })
    }

    ref is null there, and in React 19 cloneElement(child, { ref: null }) overwrites the child's own ref prop. Every combobox dropdown in Plane puts ref={setPopperElement} on the single <div> directly inside <Combobox.Options>. So that ref never fires, popperElement stays null, usePopper never creates an instance, and the panel keeps react-popper's initial position: absolute; left: 0; top: 0, the top-left corner. Only Combobox uses Frozen, which is why the Listbox/Menu/Popover-based dropdowns are fine. The code is unchanged on Headless UI's main.

    We confirmed it with a minimal React 19 + jsdom render that mirrors MemberOptions. Unpatched, the panel ref never fires and the inline style stays left: 0px; top: 0px. Patched, popper attaches and positions the panel against the trigger.

    Fix: one line, as a pnpm patch

    This is the same idea as #9751: only clone when a ref is actually forwarded.

    - return isValidElement(contents) ? cloneElement(contents, { ref }) : <>{contents}</>
    + return isValidElement(contents) ? (ref == null ? contents : cloneElement(contents, { ref })) : <>{contents}</>

    Patching dist/internal/frozen.js (the ESM build, which Vite resolves through the package's import export) is enough for web/admin/space. Nothing in the build loads the CJS bundles.

    # pnpm-workspace.yaml
    patchedDependencies:
      "@headlessui/react@2.2.10": patches/@headlessui__react@2.2.10.patch

    Related: options visible but not clickable

    Headless UI v2 comboboxes are modal by default, which marks everything outside the button, input and options inert. When a dropdown renders its search Combobox.Input inside the options panel, the option list itself ends up inert. Instead of patching useInertOthers as #9751 does, passing modal={false} to Combobox.Options restores the v1 behaviour. We needed it on:

    • apps/web/core/components/dropdowns/: cycle/cycle-options, estimate, intake-state/base, member/member-options, module/module-options, priority, project/base, state/base, date, date-range
    • apps/web/core/components/issues/: issue-detail/label/select/label-select, issue-layouts/properties/label-dropdown, select/base
    • packages/ui/src/: dropdowns/custom-search-select, dropdowns/custom-select, dropdown/single-select

    The date pickers matter too. With modal on, v2 applies its scroll lock and inert handling while the picker is open, so the next dropdown takes two clicks to open.

    We've deployed both changes. Happy to open a PR if that helps.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions