ui icon indicating copy to clipboard operation
ui copied to clipboard

When putting a Select inside a dialog or Sheet the hover effect on the select items doesn't work

Open aamancio opened this issue 1 year ago • 13 comments

aamancio avatar Oct 01 '23 20:10 aamancio

My guess there some sort of issue with the z-index.

aamancio avatar Oct 01 '23 20:10 aamancio

My guess there some sort of issue with the z-index.

I ran into this problem as well. When I open the Select dropdown for the first time I can hover just fine, but if I close and open it again hover stops working.

I noticed that if I clicked outside of Select (eg clicking on an input in the same form), the close event triggered twice and it will focus back on the Select trigger.

I tried to replicate it on codesandbox but couldn't.

minhson3012 avatar Oct 02 '23 01:10 minhson3012

I'm facing the same issue!

dukeeagle avatar Oct 13 '23 03:10 dukeeagle

I'm facing the same issue!

Try adding this into your package.json and let me know if it works for you

"resolutions": {
  "@radix-ui/react-focus-scope": "^1.0.4"
}

minhson3012 avatar Oct 13 '23 03:10 minhson3012

T

I'm facing the same issue!

Try adding this into your package.json and let me know if it works for you

"resolutions": {
  "@radix-ui/react-focus-scope": "^1.0.4"
}

have the same issue. tried the above and hasnt fixed. Does anyone have a fix?

step2341 avatar Oct 17 '23 00:10 step2341

https://github.com/radix-ui/primitives/issues/2448#issuecomment-1758438552

joaom00 avatar Oct 17 '23 02:10 joaom00

radix-ui/primitives#2448 (comment)

@joaom00 i've tried this and it didnt appear to help. are you able to summarize the steps to implement?

step2341 avatar Oct 17 '23 23:10 step2341

radix-ui/primitives#2448 (comment)

@joaom00 i've tried this and it didnt appear to help. are you able to summarize the steps to implement?

What I did was that I added react-focus-scope and dismissable-layer into resolutions, deleted yarn.lock and node_modules and ran yarn again.

minhson3012 avatar Oct 17 '23 23:10 minhson3012

@minhson3012 thanks that worked. didn't realize i needed both. also note if using npm need to use "overrides" in place of resolutions..

step2341 avatar Oct 18 '23 00:10 step2341

For me the solution using npm was:

"overrides": {
  "@radix-ui/react-dismissable-layer": "^1.0.5",
  "@radix-ui/react-focus-scope": "^1.0.4"
}

ManuDoni avatar Oct 18 '23 12:10 ManuDoni

Where to add it?

lucasjinreal avatar Nov 19 '23 06:11 lucasjinreal

@lucasjinreal Add it to package.json file and then run npm install again~

zaleGZL avatar Nov 19 '23 09:11 zaleGZL

Why this work?

lucasjinreal avatar Nov 19 '23 10:11 lucasjinreal

This issue has been automatically closed because it received no activity for a while. If you think it was closed by accident, please leave a comment. Thank you.

shadcn avatar Feb 27 '24 23:02 shadcn

I believe this issue still exists. I am unable to use Clerk modal components inside a Shadcn Sheet, they show up but will not let me click on them

moeyyad avatar Apr 27 '24 02:04 moeyyad

I believe this issue still exists. I am unable to use Clerk modal components inside a Shadcn Sheet, they show up but will not let me click on them

@moeyyad Encountering the same problem, did you manage to fix it?

robbyyt avatar May 11 '24 13:05 robbyyt

Still having the same issue, only this solution works for me.

For me the solution using npm was:

"overrides": {
  "@radix-ui/react-dismissable-layer": "^1.0.5",
  "@radix-ui/react-focus-scope": "^1.0.4"
}

HTLA380 avatar Jun 18 '24 15:06 HTLA380

Issue still exists. Putting a Select in a Sheet gives behavior of SelectContent items being unselectable.

Screenshot 2024-06-22 at 10 48 36 PM

hsavit1 avatar Jun 23 '24 02:06 hsavit1

This works for me after remove .next, node_modules, package-lock.json

Finally npm i

For me the solution using npm was:

"overrides": {
  "@radix-ui/react-dismissable-layer": "^1.0.5",
  "@radix-ui/react-focus-scope": "^1.0.4"
}

akzone avatar Jun 23 '24 18:06 akzone

For me the solution using npm was:

"overrides": {
  "@radix-ui/react-dismissable-layer": "^1.0.5",
  "@radix-ui/react-focus-scope": "^1.0.4"
}

This works for me, thanks a lot, i installed the same dependencies but still don't know the why it works (using vite)

npm install @radix-ui/react-focus-scope
npm install @radix-ui/react-dismissable-layer

Brendon3578 avatar Jun 23 '24 23:06 Brendon3578

This works for me after remove .next, node_modules, package-lock.json

Finally npm i

For me the solution using npm was:

"overrides": {
  "@radix-ui/react-dismissable-layer": "^1.0.5",
  "@radix-ui/react-focus-scope": "^1.0.4"
}

I've finally been able to solve this issue. Thanks everyone

YagoLeite avatar Jun 27 '24 20:06 YagoLeite

For me the solution using npm was:

"overrides": {
  "@radix-ui/react-dismissable-layer": "^1.0.5",
  "@radix-ui/react-focus-scope": "^1.0.4"
}

Issue still exists and it does not work if placing a Date Picker on a Drawer.

littlebutt avatar Jun 28 '24 14:06 littlebutt

I am encountering the same issue when using Clerk's UserButton in Sheet. I also tried the overrides, but it didn't fix the problem.

My repo: https://github.com/Hamzi-SE/discord-clone

Edit: Fixed it using this code:

<UserButton
        appearance={{
          elements: { userButtonPopoverCard: { pointerEvents: "initial" } },
        }} 
/>

Hamzi-SE avatar Jul 04 '24 20:07 Hamzi-SE

For me the solution using npm was:

"overrides": {
  "@radix-ui/react-dismissable-layer": "^1.0.5",
  "@radix-ui/react-focus-scope": "^1.0.4"
}

Issue still exists and it does not work if placing a Date Picker on a Drawer.

Faced this problem too. Here's what helped me https://github.com/shadcn-ui/ui/issues/910#issuecomment-1770255810

kamtoeddy avatar Jul 14 '24 16:07 kamtoeddy

image

This issue related with this.

So is there any solution for this problem?

cupid20103 avatar Aug 13 '24 23:08 cupid20103

Wow, I've solved this problem. In my case, that is related with z-index. I've updated the select.tsx file.

image

cupid20103 avatar Aug 14 '24 00:08 cupid20103