Skip to content

Fix: Opening a modal with scrollbar-gutter: stable shifts the page content and shows white (non grey-overlayed) gutters#40789

Closed
ac-mmi wants to merge 41 commits into
twbs:mainfrom
ac-mmi:main
Closed

Fix: Opening a modal with scrollbar-gutter: stable shifts the page content and shows white (non grey-overlayed) gutters#40789
ac-mmi wants to merge 41 commits into
twbs:mainfrom
ac-mmi:main

Conversation

@ac-mmi

@ac-mmi ac-mmi commented Sep 3, 2024

Copy link
Copy Markdown

This pull request addresses #40659 issue.

I have updated the modal SCSS file to include a fix that targets the content shift issue when the scrollbar-gutter: stable both-edges property is used. Specifically:

  • I added a @supports rule that checks if the browser supports scrollbar-gutter: stable both-edges.
  • When the modal is open (.modal-open class is applied to the body), the additional padding-right adjustment is removed, preventing the content from shifting unexpectedly.

This fix ensures that the modal behavior remains consistent and that no unnecessary padding is applied when scrollbar-gutter: stable both-edges is present.

Closes #40659

@mdo

mdo commented Jun 26, 2026

Copy link
Copy Markdown
Member

Fixed in v6-dev by #42545, which moves the dialog scroll-lock to :root so it co-locates with scrollbar-gutter: stable (no content shift / white gutter) — the same #40659 this addresses. Closing in favor of the v6 work; thanks for the investigation here.

@mdo mdo closed this Jun 26, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Opening a modal with scrollbar-gutter: stable shifts the page content and shows white (non grey-overlayed) gutters

3 participants