saadeghi / daisyui

๐ŸŒผ ๐ŸŒผ ๐ŸŒผ ๐ŸŒผ ๐ŸŒผ โ€ƒThe most popular, free and open-source Tailwind CSS component library
https://daisyui.com
MIT License
32.03k stars 1.24k forks source link

bug: Modal Dialog Adds A None Existent Scrollbar Spacing To Backdrop #3040

Open MunkeeJuice opened 1 month ago

MunkeeJuice commented 1 month ago

What version of daisyUI are you using?

4.10.5

Which browsers are you seeing the problem on?

Chrome, Edge

Reproduction URL

https://play.tailwindcss.com/V7z8gOaVTT

Describe your issue

When a modal dialog opens the backdrop behind shifts left due to a space appearing where the y-scrollbar should be, even though it is not showing a scrollbar before the dialog is opened.

github-actions[bot] commented 1 month ago

Thank you @MunkeeJuice for reporting issues. It helps daisyUI a lot ๐Ÿ’š
I'll be working on issues one by one. I will help with this one as soon as a I find a solution.
In the meantime providing more details and reproduction links would be helpful.

MunkeeJuice commented 1 month ago

As far as i can see this only happens on Chromium based browsers, the issue does not occur in firefox

keksiskela commented 1 month ago

Same behavior with drawers (the code is pretty much identical to stock navbar + drawer component); only on Chrome, and only on desktop. Seems to affect all overlays.

https://play.tailwindcss.com/Dgv6PeF5C4

simonechebelnome commented 1 month ago

I'm having the same problem, did anyone find a solution? I've tried overriding the ::-webkit-scrollbar pseudo class with no results

mpoweredo commented 1 month ago
html {
  scrollbar-gutter: auto !important;
}

seems to fix the issue

valeiras commented 3 weeks ago
html {
  scrollbar-gutter: auto !important;
}

seems to fix the issue

I tried this and it worked great! But then, when there really was a scrollbar in the background, it wouldn't create it. I finally went with:

html {
  scrollbar-gutter: stable;
}

The dummy scrollbar still appears, but there is no layout shift

Sergiocobra commented 20 hours ago

I'm still having this same issue, is there any improvement on this?