primitives icon indicating copy to clipboard operation
primitives copied to clipboard

Select component unexpectedly closes popover when clicking between select components

Open joeetwork opened this issue 1 year ago • 3 comments

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

joeetwork avatar Oct 02 '24 10:10 joeetwork

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"

sahanediriweerazoomi avatar Oct 04 '24 06:10 sahanediriweerazoomi

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.

joeetwork avatar Oct 04 '24 08:10 joeetwork

Yeah. Hope there would be a fix for this

sahanediriweerazoomi avatar Oct 04 '24 08:10 sahanediriweerazoomi

Update all radix packages to the latest versions and use --exact flag.

ereburg avatar Nov 04 '24 12:11 ereburg

Update all radix packages to the latest versions and use --exact flag.

Probably the most obvious solution, and yet I spent hours trying to find a clever fix before stumbling upon your comment. Upgrading everything totally worked - thank you!

zknicker avatar Apr 12 '25 06:04 zknicker