Skip to content

Commit e1a6c38

Browse files
Nick Lefeverfacebook-github-bot
authored andcommitted
Fix overflow with Props 2.0 in horizonal scroll view (#53872)
Summary: Pull Request resolved: #53872 This diff fixes the mismatch between the overflow initial value between the horizontal scroll view component initialization and the React core props instance initial value by applying the same correction as for the vertical scroll view component. Changelog: [Internal] Reviewed By: rshest Differential Revision: D82919365 fbshipit-source-id: 70e40f56ffa3ea87fa74035c885608f633890610
1 parent e314f61 commit e1a6c38

1 file changed

Lines changed: 12 additions & 2 deletions

File tree

packages/react-native/ReactAndroid/src/main/java/com/facebook/react/views/scroll/ReactHorizontalScrollView.java

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -158,7 +158,12 @@ private void initView() {
158158
mOverflowInset = new Rect();
159159
mActivelyScrolling = false;
160160
mClippingRect = null;
161-
mOverflow = Overflow.SCROLL;
161+
// The default value for `overflow` is set to `Visible` in the Yoga style props.
162+
mOverflow =
163+
ReactNativeFeatureFlags.enablePropsUpdateReconciliationAndroid()
164+
? Overflow.VISIBLE
165+
: Overflow.SCROLL;
166+
162167
mDragging = false;
163168
mPagingEnabled = false;
164169
mPostTouchRunnable = null;
@@ -381,7 +386,12 @@ public void setOverflow(@Nullable String overflow) {
381386
mOverflow = Overflow.SCROLL;
382387
} else {
383388
@Nullable Overflow parsedOverflow = Overflow.fromString(overflow);
384-
mOverflow = parsedOverflow == null ? Overflow.SCROLL : parsedOverflow;
389+
mOverflow =
390+
parsedOverflow == null
391+
? (ReactNativeFeatureFlags.enablePropsUpdateReconciliationAndroid()
392+
? Overflow.VISIBLE
393+
: Overflow.SCROLL)
394+
: parsedOverflow;
385395
}
386396

387397
invalidate();

0 commit comments

Comments
 (0)