Skip to content

Reset contentInset in scroll view prepareForRecycle#55733

Closed
sbuggay wants to merge 1 commit intofacebook:mainfrom
sbuggay:export-D93342311
Closed

Reset contentInset in scroll view prepareForRecycle#55733
sbuggay wants to merge 1 commit intofacebook:mainfrom
sbuggay:export-D93342311

Conversation

@sbuggay
Copy link
Contributor

@sbuggay sbuggay commented Feb 25, 2026

Summary:
React Native's Fabric view recycling pools UIScrollView instances by component type, meaning vertical and horizontal scroll views share the same pool. When a scroll view is recycled via prepareForRecycle, contentInset is not reset. This causes stale bottom insets set at runtime (e.g., by the floating tab bar's content inset adjustment) to leak into recycled scroll views.

This manifests as horizontal FlatLists allowing vertical/diagonal scrolling because they inherit a non-zero bottom contentInset from a previously vertical scroll view.

Fix: Reset contentInset to UIEdgeInsetsZero in prepareForRecycle, consistent with how contentOffset, zoomScale, and contentInsetAdjustmentBehavior are already reset.

More Context: https://fb.workplace.com/groups/rn.support/posts/30810820418539846/?comment_id=30811286738493214&reply_comment_id=30821628410792380

Reviewed By: cipolleschi

Differential Revision: D93342311

@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 Feb 25, 2026
@meta-codesync
Copy link

meta-codesync bot commented Feb 25, 2026

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

sbuggay pushed a commit to sbuggay/react-native that referenced this pull request Feb 25, 2026
Summary:

React Native's Fabric view recycling pools UIScrollView instances by component type, meaning vertical and horizontal scroll views share the same pool. When a scroll view is recycled via prepareForRecycle, contentInset is not reset. This causes stale bottom insets set at runtime (e.g., by the floating tab bar's content inset adjustment) to leak into recycled scroll views.

This manifests as horizontal FlatLists allowing vertical/diagonal scrolling because they inherit a non-zero bottom contentInset from a previously vertical scroll view.

Fix: Reset contentInset to UIEdgeInsetsZero in prepareForRecycle, consistent with how contentOffset, zoomScale, and contentInsetAdjustmentBehavior are already reset.

Changelog: Internal

More Context: https://fb.workplace.com/groups/rn.support/posts/30810820418539846/?comment_id=30811286738493214&reply_comment_id=30821628410792380

Reviewed By: cipolleschi

Differential Revision: D93342311
sbuggay pushed a commit to sbuggay/react-native that referenced this pull request Feb 25, 2026
Summary:
Pull Request resolved: facebook#55733

React Native's Fabric view recycling pools UIScrollView instances by component type, meaning vertical and horizontal scroll views share the same pool. When a scroll view is recycled via prepareForRecycle, contentInset is not reset. This causes stale bottom insets set at runtime (e.g., by the floating tab bar's content inset adjustment) to leak into recycled scroll views.

This manifests as horizontal FlatLists allowing vertical/diagonal scrolling because they inherit a non-zero bottom contentInset from a previously vertical scroll view.

Fix: Reset contentInset to UIEdgeInsetsZero in prepareForRecycle, consistent with how contentOffset, zoomScale, and contentInsetAdjustmentBehavior are already reset.

Changelog: Internal

More Context: https://fb.workplace.com/groups/rn.support/posts/30810820418539846/?comment_id=30811286738493214&reply_comment_id=30821628410792380

Reviewed By: cipolleschi

Differential Revision: D93342311
@sbuggay sbuggay force-pushed the export-D93342311 branch 2 times, most recently from 53fc616 to e456a24 Compare February 25, 2026 19:13
sbuggay pushed a commit to sbuggay/react-native that referenced this pull request Feb 25, 2026
Summary:

React Native's Fabric view recycling pools UIScrollView instances by component type, meaning vertical and horizontal scroll views share the same pool. When a scroll view is recycled via prepareForRecycle, contentInset is not reset. This causes stale bottom insets set at runtime (e.g., by the floating tab bar's content inset adjustment) to leak into recycled scroll views.

This manifests as horizontal FlatLists allowing vertical/diagonal scrolling because they inherit a non-zero bottom contentInset from a previously vertical scroll view.

Fix: Reset contentInset to UIEdgeInsetsZero in prepareForRecycle, consistent with how contentOffset, zoomScale, and contentInsetAdjustmentBehavior are already reset.

Changelog: Internal

More Context: https://fb.workplace.com/groups/rn.support/posts/30810820418539846/?comment_id=30811286738493214&reply_comment_id=30821628410792380

Reviewed By: cipolleschi

Differential Revision: D93342311
Summary:
Pull Request resolved: facebook#55733

React Native's Fabric view recycling pools UIScrollView instances by component type, meaning vertical and horizontal scroll views share the same pool. When a scroll view is recycled via prepareForRecycle, contentInset is not reset. This causes stale bottom insets set at runtime (e.g., by the floating tab bar's content inset adjustment) to leak into recycled scroll views.

This manifests as horizontal FlatLists allowing vertical/diagonal scrolling because they inherit a non-zero bottom contentInset from a previously vertical scroll view.

Fix: Reset contentInset to UIEdgeInsetsZero in prepareForRecycle, consistent with how contentOffset, zoomScale, and contentInsetAdjustmentBehavior are already reset.

Changelog: Internal

More Context: https://fb.workplace.com/groups/rn.support/posts/30810820418539846/?comment_id=30811286738493214&reply_comment_id=30821628410792380

Reviewed By: cipolleschi

Differential Revision: D93342311
@meta-codesync meta-codesync bot closed this in 984dbe8 Feb 25, 2026
@facebook-github-bot facebook-github-bot added the Merged This PR has been merged. label Feb 25, 2026
@meta-codesync
Copy link

meta-codesync bot commented Feb 25, 2026

This pull request has been merged in 984dbe8.

@react-native-bot
Copy link
Collaborator

This pull request was successfully merged by @sandeee1928 in 984dbe8

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. fb-exported 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.

4 participants