You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[Bug]: Dialog / Sheet should NOT add pointer-events: none to body tag when opened #1540
(Would actually like a "Discussion" tag as this isn't really a bug)
Both the Dialog and Sheet components are setting pointer-events: none to the body tag when opened. This prevents using things like lightboxes above the Sheet, or emoji pickers inside of a Dialog. I've had numerous issues with this already and just now realized the cause of the issue.
I don't think it's necessary to set this on the body tag and would likely be better not to due to these issues.
If there are edge cases, users can simply add a z-index to solve the vast majority of issues.
Would like to see some discussion about this and find a better way to cover whatever reasons there were when this was first added.
For now, I'm just manually removing it as needed, but the issue isn't at first obvious and could cause a lot of wasted time for devs.
This is also an issue for me. It's causing the overlay to appear to be clicked, which means that if anything that isn't an input is clicked inside the model, including whitespace, it closes.
Howdy folks,
I was having issues like this and figured out it was caused by having some components on radix-vue and some components on reka-ui. These packages are not compatible and using components from each of them will result in some strange behaviour.
If you're using the shadcn-vue library it's a pretty simple fix. Just update all of your components using npx shadcn-vue@latest add <component> and then remove the radix-vue dependency from your package.json
I am unsure what the motivation is behind adding pointer-events: none to the document body. It is coming from the packages/core/src/shared/useBodyScrollLock.ts composable.
If the intention is to lock scrolling, then I think adding overflow: hidden to the body style should be sufficient?
I would be happy to create a PR if that is desired. Removing one line ought to be simple enough.
Activity
sadeghbarati commentedon Nov 28, 2024
Your Stackblitz link is not ready, you need to save the playground or fork it
artyom12211 commentedon Jan 5, 2025
+1
It would be nice add it when needed.
The73756 commentedon Mar 3, 2025
+1
kilakewe commentedon Mar 14, 2025
This is also an issue for me. It's causing the overlay to appear to be clicked, which means that if anything that isn't an input is clicked inside the model, including whitespace, it closes.
kilakewe commentedon Mar 14, 2025
Actually, I found my issue to be caused by the accidental use of ModalContent twice.
tombanksme commentedon Mar 25, 2025
Howdy folks,
I was having issues like this and figured out it was caused by having some components on
radix-vueand some components onreka-ui. These packages are not compatible and using components from each of them will result in some strange behaviour.If you're using the
shadcn-vuelibrary it's a pretty simple fix. Just update all of your components usingnpx shadcn-vue@latest add <component>and then remove theradix-vuedependency from yourpackage.jsonHope this helps!
kieran-artworker commentedon Apr 23, 2025
I am also running into a problem with this.
I am unsure what the motivation is behind adding
pointer-events: noneto the document body. It is coming from thepackages/core/src/shared/useBodyScrollLock.tscomposable.If the intention is to lock scrolling, then I think adding
overflow: hiddento the body style should be sufficient?I would be happy to create a PR if that is desired. Removing one line ought to be simple enough.
spaceemotion commentedon Apr 23, 2025
@kieran-artworker that won't work for our use case.
however, i am surprised that a scroll lock is not added to the dialogue background instead of the body? 🤔
SoslanZS commentedon May 5, 2025
Has anyone managed to solve the problem? I also tried what @tombanksme suggested. Unfortunately, it didn't help me.
I temporarily solved the problem by hanging on
bodypointer-events: none !important;But this is the solution that I would like to use.
feat!: Base UI scroll lock and modality, no body pointer-events (#2822)…