Skip to content

Conversation

@mattcosta7
Copy link
Contributor

@mattcosta7 mattcosta7 commented Jan 12, 2026

Remove content-visibility property from dragging elements.

Overview

When dragging elements, the content-visibility CSS property was causing the browser to skip rendering the content of off-screen elements. This resulted in the element's size changing during drag operations, which caused scroll jumping and layout instability when the container was resized.

By removing content-visibility from dragging elements, we ensure that the element maintains its correct size throughout the drag operation, preventing unexpected scroll jumps.

Closes #

Changelog

New

Changed

  • Removed content-visibility from elements during drag operations to prevent size changes and scroll jumping

Removed

Rollout strategy

  • Patch release
  • Minor release
  • Major release; if selected, include a written rollout or migration plan
  • None; if selected, include a brief description as to why

Testing & Reviewing

  1. Drag an element that previously had content-visibility applied
  2. Verify that the element maintains its size during the drag
  3. Confirm that no scroll jumping occurs when dragging near the edges of a scrollable container

Merge checklist

Remove content-visibility property from dragging elements.
@mattcosta7 mattcosta7 self-assigned this Jan 12, 2026
@changeset-bot
Copy link

changeset-bot bot commented Jan 12, 2026

🦋 Changeset detected

Latest commit: fc4fce3

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@primer/react Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@github-actions github-actions bot added the integration-tests: recommended This change needs to be tested for breaking changes. See https://arc.net/l/quote/tdmpakpm label Jan 12, 2026
@github-actions
Copy link
Contributor

👋 Hi, this pull request contains changes to the source code that github/github-ui depends on. If you are GitHub staff, test these changes with github/github-ui using the integration workflow. Or, apply the integration-tests: skipped manually label to skip these checks.

Copy link
Member

@jonrohan jonrohan left a comment

Choose a reason for hiding this comment

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

Nice catch 👍🏻

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR fixes a scroll jumping bug in PageLayout by removing the content-visibility CSS property from elements during drag/resize operations. The property was causing incorrect size calculations for off-screen content, leading to layout instability.

Changes:

  • Removed content-visibility: auto; from dragging elements while preserving other containment optimizations
  • Added changeset documenting the bug fix as a patch release

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

File Description
packages/react/src/PageLayout/PageLayout.module.css Removed content-visibility: auto; from .ContentWrapper[data-dragging='true'] selector to prevent size changes during drag operations
.changeset/fix-scroll-jump-on-resize.md Added changeset documenting the bug fix for scroll jumping during resize

@mattcosta7 mattcosta7 enabled auto-merge January 12, 2026 19:43
@primer-integration
Copy link

👋 Hi from github/github-ui! Your integration PR is ready: https://github.com/github/github-ui/pull/10450

@primer-integration
Copy link

Integration test results from github/github-ui:

Passed  CI   Passed
Passed  VRT   Passed
Passed  Projects   Passed

All checks passed!

@mattcosta7 mattcosta7 added this pull request to the merge queue Jan 12, 2026
Merged via the queue into main with commit 4072e44 Jan 12, 2026
58 checks passed
@mattcosta7 mattcosta7 deleted the mattcosta7-patch-1 branch January 12, 2026 20:11
@primer primer bot mentioned this pull request Jan 12, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

integration-tests: recommended This change needs to be tested for breaking changes. See https://arc.net/l/quote/tdmpakpm

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants