Skip to content

Report padding box from scroll view getClipBounds when overflow is not visible - #60285

Merged
meta-codesync[bot] merged 1 commit into
react:mainfrom
cipolleschi:export-D134353417
Nov 25, 2026
Merged

meta-codesync[bot] merged 1 commit into
react:mainfrom
cipolleschi:export-D134353417

Conversation

@cipolleschi

Copy link
Copy Markdown
Contributor

Summary:
Problem: Systems that read a view's clip region through View.getClipBounds see React Native scroll views as unclipped. ReactViewGroup already reports its padding box there when overflow is not visible, behind the syncAndroidClipBoundsWithOverflow feature flag. The scroll views always return the default.

Fix: Add the same two getClipBounds overrides to ReactScrollView and ReactHorizontalScrollView, and regenerate ReactNestedScrollView from ReactScrollView. The returned rect is the unscrolled padding box, because scrolling translates only the children.

Risk: Only effective when syncAndroidClipBoundsWithOverflow is on (default off). With the flag on, every scroll view with non-visible overflow (the JS ScrollView default) reports a clip. Nothing inside React Native reads getClipBounds, so drawing does not change.

Review focus: Confirm that the unscrolled padding box is the right coordinate space for clip-bounds consumers.

Changelog: [Internal]

Reviewed By: christophpurrer

Differential Revision: D134353417

…t visible

Summary:
**Problem:** Systems that read a view's clip region through `View.getClipBounds` see React Native scroll views as unclipped. `ReactViewGroup` already reports its padding box there when overflow is not visible, behind the `syncAndroidClipBoundsWithOverflow` feature flag. The scroll views always return the default.

**Fix:** Add the same two `getClipBounds` overrides to `ReactScrollView` and `ReactHorizontalScrollView`, and regenerate `ReactNestedScrollView` from `ReactScrollView`. The returned rect is the unscrolled padding box, because scrolling translates only the children.

**Risk:** Only effective when `syncAndroidClipBoundsWithOverflow` is on (default off). With the flag on, every scroll view with non-visible overflow (the JS `ScrollView` default) reports a clip. Nothing inside React Native reads `getClipBounds`, so drawing does not change.

**Review focus:** Confirm that the unscrolled padding box is the right coordinate space for clip-bounds consumers.

Changelog: [Internal]

Reviewed By: christophpurrer

Differential Revision: D134353417
@meta-codesync

meta-codesync Bot commented Nov 25, 2026

Copy link
Copy Markdown

@cipolleschi has exported this pull request. If you are a Meta employee, you can view the originating Diff in D134353417.

@meta-cla meta-cla Bot added the CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. label Nov 25, 2026

@christophpurrer christophpurrer left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Review automatically exported from Phabricator review in Meta.

@github-actions

Copy link
Copy Markdown

Visual regression

No visual differences at f18ede9c27aa.

ios: no capture

@meta-codesync
meta-codesync Bot merged commit 9d6a249 into react:main Nov 25, 2026
65 checks passed
@react-native-bot

Copy link
Copy Markdown
Collaborator

This pull request was successfully merged by @cipolleschi in 9d6a249

When will my fix make it into a release? | How to file a pick request?

@react-native-bot react-native-bot added the Merged This PR has been merged. label Nov 25, 2026
@react-native-bot

Copy link
Copy Markdown
Collaborator

This pull request was successfully merged by @cipolleschi in 9d6a249

When will my fix make it into a release? | How to file a pick request?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. Merged This PR has been merged. meta-exported p: Facebook Partner: Facebook Partner

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants