Skip to content

[useScrollLock] Backdrops not covering scrollbar area in macOS #4615

Closed

Description

@hexcowboy

Bug report

Current behavior

The backdrop seems to not cover the area where the scrollbar is.

Image

This happens with either "Automatically based on mouse or trackpad" and "Always" scrollbar behaviors in macOS

Image

Expected behavior

This is Radix behavior no matter what scrollbar behavior is selected:

Image

Reproducible example

Reproduced in live docs.

Base UI version

Version 1.4.0

Which browser are you using?

Reproduced in Chrome and Safari

Which OS are you using?

macOS

Which assistive tech are you using (if applicable)?

N/A

Activity

  1. added
    status: waiting for maintainer
    on Apr 14, 2026
  2. added
    component: dialog
    on Apr 14, 2026
  3. mj12albert commented on Apr 14, 2026

    @mj12albert
    Member

    Seems to be a scroll lock issue (happens with menu, select as well), I can repro in Safari but Chrome is fine:
    Image

  4. changed the title [-]Dialog Backdrop not covering scrollbar area in macOS[/-] [+][useScrollLock] Backdrops not covering scrollbar area in macOS[/+] on Apr 14, 2026
  5. removed
    status: waiting for maintainer
    on Apr 14, 2026
  6. atomiks commented on Apr 15, 2026

    @atomiks
    Contributor

    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.

  7. added
    type: expected behavior
    on Apr 15, 2026
  8. hexcowboy commented on Apr 15, 2026

    @hexcowboy
    Author

    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-avoid property 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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    component: dialogtype: expected behavior

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions