From a4b3a016738b8fc8c9fe9466b41d1ecf7532ba44 Mon Sep 17 00:00:00 2001 From: Adam Ivancza Date: Thu, 9 Jul 2026 12:00:00 +0200 Subject: [PATCH] Fix ScrollView recycled content inset --- .../ComponentViews/ScrollView/RCTScrollViewComponentView.mm | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/packages/react-native/React/Fabric/Mounting/ComponentViews/ScrollView/RCTScrollViewComponentView.mm b/packages/react-native/React/Fabric/Mounting/ComponentViews/ScrollView/RCTScrollViewComponentView.mm index 548987ff291d..45c69b13f4b9 100644 --- a/packages/react-native/React/Fabric/Mounting/ComponentViews/ScrollView/RCTScrollViewComponentView.mm +++ b/packages/react-native/React/Fabric/Mounting/ComponentViews/ScrollView/RCTScrollViewComponentView.mm @@ -696,8 +696,7 @@ - (void)prepareForRecycle // Invalidate cached content size so that updateState: recalculates the // container frame after zoomScale reset (which may have mutated it in RTL). _contentSize = CGSizeZero; - // Reset contentInset to prevent stale insets leaking into recycled scroll views. - _scrollView.contentInset = UIEdgeInsetsZero; + _scrollView.contentInset = RCTUIEdgeInsetsFromEdgeInsets(props.contentInset); // We set the default behavior to "never" so that iOS // doesn't do weird things to UIScrollView insets automatically // and keeps it as an opt-in behavior.