-
Notifications
You must be signed in to change notification settings - Fork 5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Dialog & DropdownMenu adds pointer-events: none; #1859
Comments
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. |
It's still an issue! I have to manually add a
I also tried manually passing open to it like so
which also doesn't work. This needs to be fixed! |
Sure, this issue need to be re open, but this css work with me for temporary /* global.css */
body {
pointer-events: auto !important;
} |
Also running into this. Hm. Does not seem fixed. |
Bumping this because it's still an issue... |
Experiencing the same problem. |
Same here. Really sad because its annoying. The CSS-Trick will work, but I think this is not the best solution since it is a bug. |
thanks bro its working perfectly |
I you are using a Dropdown Item to trigger a modal, a simple solution to this problem is adding |
Both the CSS modification 'fix' and // Track the state yourself
const [open, setOpen] = useState(false)
// Pass it to the DropdownMenu
<DropdownMenu
open={open}
onOpenChange={(isOpen) => {
setOpen(isOpen)
}}
>
// Close the dropdown before opening any modal
<DropdownMenuItem
onClick={() => {
setOpen(false)
pushModal('YourModal')
}}
> |
I just came across this issue, it's something to do with how the AlertDialog works as this issue doesn't exist on a normal Dialog (I've not used the normal Dialog inside a drop-down menu yet though not 💯 sure) For now I've just added the CSS fix which seems to fix it but not sure about the long term effects. For some reason when you control the state yourself it's not performing the cleanup on the bodys pointer:events none styling which leads the entire UI unusable 🫠 Not a great fix bit it'll do as I spotted this at the last minute so it's good enough for now. |
This did it for me. I was hesitant to try the pointer-events: auto !important; because of potential downstream effects. Thank you |
This fixed my issue. |
Did you still get the backdrop on the AlertDialog ? |
This happens with a normal dialog for me too. I believe radix-ui/primitives#837. I don't believe it is fixed as of yet. Messing with the pointer events of the entire body might conflict with other dialog providers too, so I'd be interested in a solution that doesn't require that. |
Yes @AlexMachin1997 |
…s/add This was an issue with shadcn and is open here: shadcn-ui/ui#1859.
This also resolved my issue. Thanks! |
so |
In my case the popovers where this was an issue were all under a top-level div with data-portal="true". So I just added this to my global CSS to fix it:
|
December 2024 and the issue persist |
Issue occurs when you have a
DropdownMenu
that contains aDropdownMenuItem
that has anonClick
that triggers a dialog display.Simple reproduction, just add a dialog to the above and when the dialog opens you'll get the class added, blocking your UI.
Ref: #1685
modal={false}
didn't work for me.The text was updated successfully, but these errors were encountered: