Skip to content

Select inside Dialog or Popover closes both components unexpectedly on mobile #3461

Open
@KaueFelipeThums

Description

@KaueFelipeThums

Bug report

Current Behavior

When using @radix-ui/react-select inside a @radix-ui/react-dialog or @radix-ui/react-popover, on mobile devices (or emulated touch devices), opening the Select and then closing it by clicking inside the Dialog or Popover sometimes causes both the Select and the Dialog/Popover to close unexpectedly.

This issue is inconsistent but occurs more frequently on mobile or touch-enabled devices.

Expected Behavior

Only the Select should close when clicking outside its content but still within the boundaries of the Dialog or Popover. The parent Dialog/Popover should remain open.

Reproducible Example

492288a1-c89b-4c8d-99d7-72f3702b646c.webm

Steps to reproduce:

  1. Open on a mobile device or in responsive mode (DevTools).
  2. Open the Dialog or Popover.
  3. Inside it, open the Select.
  4. Click somewhere inside the Dialog but outside the Select content.
  5. Notice that sometimes the Dialog/Popover closes along with the Select.

Suggested Solution

This might be related to focus management or pointerdown/mousedown events being propagated from the Select to the parent component. Preventing event propagation when closing the Select might help avoid the parent Dialog/Popover from closing.

Additional Context

  • This issue seems to occur more frequently on mobile/touch devices.
  • Possibly related to how portals are mounted/unmounted or how event bubbling is handled between Select and Dialog.

Environment

Software Name(s) Version
Radix Package(s) @radix-ui/react-select 2.1.7
@radix-ui/react-dialog 1.1.7
React 19.0.0
Browser Chrome 133.0.6943.126
Assistive tech
Node 23.8.0
npm 10.9.2
Operating System Ubuntu 24.04

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions