Skip to content

fix(web): menus and dialogs no longer shift the page left (web 0.63.1) - #637

Merged
kroqdotdev merged 2 commits into
mainfrom
fix/scroll-lock-page-shift
Nov 10, 2026
Merged

kroqdotdev merged 2 commits into
mainfrom
fix/scroll-lock-page-shift

Conversation

@kroqdotdev

Copy link
Copy Markdown
Owner

Summary

Opening the site switcher (or any Radix menu or dialog) moved the whole page a few pixels to the left.

html has scrollbar-gutter: stable, so the scrollbar's space is always reserved. Radix locks scrolling with react-remove-scroll, which also sets margin-right: <scrollbar width>px !important on body to make up for the hidden scrollbar. With the gutter already in place, that margin shifted the page a second time (10px margin, 5px shift of centred content in a local check).

The fix sets body[data-scroll-locked] { margin-right: 0 !important; } in the base layer. An !important declaration in a cascade layer beats the library's unlayered !important, so specificity and injection order do not matter.

Testing

  • On the local dev server, measured the switcher's position before and after opening the menu: it moved 5px without the rule and did not move with it; body margin stays 0px while locked.

Web 0.63.1 with a changelog entry.

🤖 Generated with Claude Code

The html element keeps a stable scrollbar gutter, and Radix's scroll lock
(react-remove-scroll) also adds a body margin the width of the scrollbar,
so the page moved left whenever a menu or dialog opened. Zero that margin
while the lock is on.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@coderabbitai

coderabbitai Bot commented Nov 10, 2026 •

Copy link
Copy Markdown

Important

  • Trigger review

This repository does not receive automatic reviews because it has fewer than 10 stars.

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: c354cb75-015b-4e7f-a5e9-57906046d40e
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

@github-actions

Copy link
Copy Markdown

⚠️ Deprecation Warning: The deny-licenses option is deprecated for possible removal in the next major release. For more information, see issue 997.

Dependency Review

✅ No vulnerabilities or license issues or OpenSSF Scorecard issues found.

Scanned Files

None

…ported

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@kroqdotdev
kroqdotdev merged commit f9e330e into main Nov 10, 2026
29 checks passed
@kroqdotdev
kroqdotdev deleted the fix/scroll-lock-page-shift branch November 10, 2026 14:07
@github-actions github-actions Bot locked and limited conversation to collaborators Nov 10, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant