radix-ui / primitives

Radix Primitives is an open-source UI component library for building high-quality, accessible design systems and web apps. Maintained by @workos.
https://radix-ui.com/primitives
MIT License
15.69k stars 811 forks source link

Select component unexpectedly closes popover when clicking between select components #3166

Open joeetwork opened 3 weeks ago

joeetwork commented 3 weeks ago

Bug report

Current Behavior

When clicking between select components it closes the popover.

Example: https://github.com/user-attachments/assets/8271f90c-4f81-4942-a8ae-630131d5a908

Expected behavior

When clicking on the other select component it should either open the new select component, close the currently open select component while keeping the popover component open.

Or close the current select component while keeping the popover component open.

Reproducible example

CodeSandbox Template

Suggested solution

Additional context

Was working fine for select component v2.1.1

I have tried with popover component v1.1.1 and v1.1.2

I'm also using shadcn

Your environment

Software Name(s) Version
Radix Package(s) @radix-ui/react-select": "2.1.2", @radix-ui/react-popover": "^1.1.2"
React v18.2.0
Browser Chrome
Assistive tech
Node v18.18.0
npm/yarn v10.8.2
Operating System MacOs
sahanediriweerazoomi commented 2 weeks ago

I am also getting the error of popover closing. Think its because of the "@radix-ui/react-popover": "^1.1.2" version. I am using "@radix-ui/react-select": "^2.1.1",

I found a temporary solution of setting the dependency to "@radix-ui/react-popover": "1.1.1"

joeetwork commented 2 weeks ago

I had no issues with this error when using select 2.1.1 but I needed to upgrade because the event propagation error, unfortunately it seems to have lead to a different bug lol.

sahanediriweerazoomi commented 2 weeks ago

Yeah. Hope there would be a fix for this