Description
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:
- Open on a mobile device or in responsive mode (DevTools).
- Open the
Dialog
orPopover
. - Inside it, open the
Select
. - Click somewhere inside the
Dialog
but outside theSelect
content. - Notice that sometimes the
Dialog
/Popover
closes along with theSelect
.
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
andDialog
.
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 |