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
[useScrollLock] Backdrops not covering scrollbar area in macOS #4615
changed the title [-]Dialog Backdrop not covering scrollbar area in macOS[/-][+][useScrollLock] Backdrops not covering scrollbar area in macOS[/+]on Apr 14, 2026
This is an intentional tradeoff in the scroll-lock implementation.
When a dialog opens, removing the page scrollbar changes the document’s available width with classic/inset scrollbars, which causes layout shift for position: fixed elements. We use the scrollbar-gutter/stable-gutter approach so opening a dialog does not move the page underneath it for fixed elements. The tradeoff is that, on platforms with inset scrollbars, the scrollbar gutter can remain visually outside the backdrop instead of being covered by it.
See #604 (review) for why we made this decision. The conclusion there was that the scrollbar not being covered is not ideal visually, but avoiding layout shift is the safer default for end-user UX because developers don't take into account the right padding for fixed elements. Covering the scrollbar area usually means going back to manual scrollbar-width compensation, which is easy to get wrong and often causes unrelated fixed-position UI to shift. Radix has that exact issue while Base UI doesn't. So this is currently expected behavior.
Activity
mj12albert commentedon Apr 14, 2026
Seems to be a scroll lock issue (happens with menu, select as well), I can repro in Safari but Chrome is fine:

[-]Dialog Backdrop not covering scrollbar area in macOS[/-][+][useScrollLock] Backdrops not covering scrollbar area in macOS[/+]atomiks commentedon Apr 15, 2026
This is an intentional tradeoff in the scroll-lock implementation.
When a dialog opens, removing the page scrollbar changes the document’s available width with classic/inset scrollbars, which causes layout shift for
position: fixedelements. We use thescrollbar-gutter/stable-gutter approach so opening a dialog does not move the page underneath it forfixedelements. The tradeoff is that, on platforms with inset scrollbars, the scrollbar gutter can remain visually outside the backdrop instead of being covered by it.See #604 (review) for why we made this decision. The conclusion there was that the scrollbar not being covered is not ideal visually, but avoiding layout shift is the safer default for end-user UX because developers don't take into account the right padding for fixed elements. Covering the scrollbar area usually means going back to manual scrollbar-width compensation, which is easy to get wrong and often causes unrelated fixed-position UI to shift. Radix has that exact issue while Base UI doesn't. So this is currently expected behavior.
hexcowboy commentedon Apr 15, 2026
That makes a lot of sense.
Seems like there are some ideas in the CSSWG Editor’s Draft of the CSS Overflow Module Level 4 (https://drafts.csswg.org/css-overflow-4/) about a
scrollbar-avoidproperty that may help address this in the future. Though it looks like currently there is no standard way to cover the scrollbar area. Closing this issue.