Skip to content

[Bug]: Page jumps with scrollbar-gutter: stable after opening DropdownMenu. #2270

@jelleroorda

Description

@jelleroorda

Environment

Development/Production OS: MacOS 15.6 (24G84)
Node version: v22.16.0
Package manager: [email protected]
Reka UI version: 2.6.0
Vue version: [email protected]
Nuxt version: -
Nuxt mode: -
Nuxt target: -
CSS framework: [email protected]
Client OS: MacOS 15.6 (24G84)
Browsers: 
- Librewolf 126.0-2
- Vivaldi 7.6.3797.63 (Stable channel) (arm64)
- Safari Version 18.6 (20621.3.11.11.3)

Link to minimal reproduction

https://stackblitz.com/edit/p1ikpz27-bbcfnvxa?file=index.html

Steps to reproduce

  1. Add style="scrollbar-gutter: stable" to the html tag.
  2. Open any dropdown.

Describe the bug

Whenever you open the dropdown, the entire page jumps to the left. This probably has to do with the compensation for the scrollbar that would disappear if the page were scrollable. The following Stackblitz shows the issue quite clearly, because of the green background.

Note:

  • The scrollbar-gutter: stable ensures that the browser takes for the scrollbar, even if the content is not scrollable. This can be used to prevent jumpy page experiences on SPA applications were some pages are scrollable, and other are not.
  • When opening the dropdown menu the page jumps to the left. A padding-right: 15px; is being added to the body tag. This is now on top of the reserved scrollbar space.
  • When you remove the scrollbar-gutter: stable it works perfectly smooth like expected.

In case the Stackblitz is not available anymore, it's literally a Stackblitz fork from https://reka-ui.com/docs/components/dropdown-menu#dropdownmenu, with the only difference style=""scrollbar-gutter: stable;"`` on the html tag in index.html`

Expected behavior

I would not expect the page to jump to the left.

Context & Screenshots (if applicable)

See the following example based on the dropdown from the documentation:

Screen.Recording.2025-11-07.at.18.12.37.mov

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions