Skip to content

Commit 4591bb2

Browse files
Nick Lefeverfacebook-github-bot
authored andcommitted
Add missing ScrollView props to ScrollProps (#51167)
Summary: Pull Request resolved: #51167 Adding the ScrollView properties that are android specific to the common ScrollView props so that they can be diffed in a getDiffProps implementation. Changelog: [Internal] Reviewed By: sammy-SC Differential Revision: D74327335 fbshipit-source-id: 8e5683d4bf7fe0f6d54d4b97f535731721c60292
1 parent 68baff1 commit 4591bb2

2 files changed

Lines changed: 35 additions & 2 deletions

File tree

packages/react-native/ReactCommon/react/renderer/components/scrollview/ScrollViewProps.cpp

Lines changed: 32 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -371,7 +371,27 @@ ScrollViewProps::ScrollViewProps(
371371
rawProps,
372372
"isInvertedVirtualizedList",
373373
sourceProps.isInvertedVirtualizedList,
374-
{})) {}
374+
{})),
375+
sendMomentumEvents(
376+
ReactNativeFeatureFlags::enableCppPropsIteratorSetter()
377+
? sourceProps.sendMomentumEvents
378+
: convertRawProp(
379+
context,
380+
rawProps,
381+
"sendMomentumEvents",
382+
sourceProps.sendMomentumEvents,
383+
true)),
384+
nestedScrollEnabled(
385+
ReactNativeFeatureFlags::enableCppPropsIteratorSetter()
386+
? sourceProps.nestedScrollEnabled
387+
: convertRawProp(
388+
context,
389+
rawProps,
390+
"nestedScrollEnabled",
391+
sourceProps.nestedScrollEnabled,
392+
true))
393+
394+
{}
375395

376396
void ScrollViewProps::setProp(
377397
const PropsParserContext& context,
@@ -424,6 +444,8 @@ void ScrollViewProps::setProp(
424444
RAW_SET_PROP_SWITCH_CASE_BASIC(contentInsetAdjustmentBehavior);
425445
RAW_SET_PROP_SWITCH_CASE_BASIC(scrollToOverflowEnabled);
426446
RAW_SET_PROP_SWITCH_CASE_BASIC(isInvertedVirtualizedList);
447+
RAW_SET_PROP_SWITCH_CASE_BASIC(sendMomentumEvents);
448+
RAW_SET_PROP_SWITCH_CASE_BASIC(nestedScrollEnabled);
427449
}
428450
}
429451

@@ -558,7 +580,15 @@ SharedDebugStringConvertibleList ScrollViewProps::getDebugProps() const {
558580
debugStringConvertibleItem(
559581
"isInvertedVirtualizedList",
560582
snapToEnd,
561-
defaultScrollViewProps.isInvertedVirtualizedList)};
583+
defaultScrollViewProps.isInvertedVirtualizedList),
584+
debugStringConvertibleItem(
585+
"sendMomentumEvents",
586+
sendMomentumEvents,
587+
defaultScrollViewProps.sendMomentumEvents),
588+
debugStringConvertibleItem(
589+
"nestedScrollEnabled",
590+
nestedScrollEnabled,
591+
defaultScrollViewProps.nestedScrollEnabled)};
562592
}
563593
#endif
564594

packages/react-native/ReactCommon/react/renderer/components/scrollview/ScrollViewProps.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,9 @@ class ScrollViewProps final : public ViewProps {
7474
bool scrollToOverflowEnabled{false};
7575
bool isInvertedVirtualizedList{false};
7676

77+
bool sendMomentumEvents{};
78+
bool nestedScrollEnabled{};
79+
7780
#pragma mark - DebugStringConvertible
7881

7982
#if RN_DEBUG_STRING_CONVERTIBLE

0 commit comments

Comments
 (0)