Skip to content

Commit b37023c

Browse files
johankasperimeta-codesync[bot]
authored andcommitted
Reset zoomscale to 1 in Fabric RCTScrollViewComponentView (#54668)
Summary: Fixes #48772 and expo/expo#39984 Resets the UIScrollView zoomScale to 1 before recycling the RCTScrollViewComponentView in Fabric. ## Changelog: [IOS] [FIXED] - Reset zoomScale to 1 before recycling UIScrollView in Fabric Pull Request resolved: #54668 Test Plan: Try the snack attached in expo/expo#39984 or the steps to reproduce in the same issue. Reviewed By: fabriziocucci Differential Revision: D87923379 Pulled By: javache fbshipit-source-id: 693cb1f4b65ffdb2f0788a634e73f6c8cd27a94b
1 parent 1bdd2a0 commit b37023c

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

packages/react-native/React/Fabric/Mounting/ComponentViews/ScrollView/RCTScrollViewComponentView.mm

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -680,6 +680,8 @@ - (void)prepareForRecycle
680680

681681
const auto &props = static_cast<const ScrollViewProps &>(*_props);
682682
_scrollView.contentOffset = RCTCGPointFromPoint(props.contentOffset);
683+
// Reset zoom scale to default
684+
_scrollView.zoomScale = 1.0;
683685
// We set the default behavior to "never" so that iOS
684686
// doesn't do weird things to UIScrollView insets automatically
685687
// and keeps it as an opt-in behavior.

0 commit comments

Comments
 (0)