Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

fix: apply scrollbar-gutter only when scrollbar is present to prevent layout shift #8303

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
May 27, 2025

Conversation

chirokas
Copy link
Contributor

Closes

✅ Pull Request Checklist:

  • Included link to corresponding React Spectrum GitHub Issue.
  • Added/updated unit tests and storybook for this change (for new code or code which already has tests).
  • Filled out test instructions.
  • Updated documentation (if it already exists for this component).
  • Looked at the Accessibility Practices for this feature - Aria Practices

📝 Test Instructions:

🧢 Your Project:

@devongovett
Copy link
Member

devongovett commented May 25, 2025

Are you sure this is necessary? I don't see a layout shift in any browser here (current build on main). MDN says:

When using classic scrollbars, the gutter will be present if overflow is auto, scroll, or hidden even if the box is not overflowing. When using overlay scrollbars, the gutter will not be present.

So I don't think there should be a gutter if using overlay scrollbars.

@chirokas
Copy link
Contributor Author

So I don't think there should be a gutter if using overlay scrollbars.

The key point is that on Linux and Windows, Chromium uses non-overlay Fluent scrollbars by default.
https://chromestatus.com/feature/5693137379917824
Therefore, we still need to support this case.

@devongovett
Copy link
Member

Oh sorry, I did not understand the context here. I guess you mean if the page did not have enough content to scroll, then scrollbar-gutter would add a gutter for non-overlay scrollbars. I thought you meant it would add a gutter for overlay scrollbars.

Copy link
Member

@devongovett devongovett left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ran chromatic locally, looks good.

@devongovett devongovett added this pull request to the merge queue May 27, 2025
Merged via the queue into adobe:main with commit 444a13d May 27, 2025
29 checks passed
@chirokas chirokas deleted the scrollbar-gutter branch May 28, 2025 11:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants
Morty Proxy This is a proxified and sanitized view of the page, visit original site.