Skip to content

Commit 9022849

Browse files
RSNarafacebook-github-bot
authored andcommitted
Fix SVC for RCTScrollView
Summary: ## Failure ``` LOG SVC RCTScrollView Invalid LOG { "missing": { "validAttributes": { "borderBottomLeftRadius": true, "borderRightColor": { "process": "[Function processColor]" }, "borderRadius": true, "borderLeftColor": { "process": "[Function processColor]" }, "borderColor": { "process": "[Function processColor]" }, "borderTopRightRadius": true, "borderBottomColor": { "process": "[Function processColor]" }, "borderTopColor": { "process": "[Function processColor]" }, "borderStyle": true, "borderBottomRightRadius": true, "borderTopLeftRadius": true, "removeClippedSubviews": true } }, "unexpected": { "directEventTypes": { "topScrollToTop": { "registrationName": "onScrollToTop" } }, "validAttributes": { "alwaysBounceHorizontal": true, "alwaysBounceVertical": true, "automaticallyAdjustContentInsets": true, "automaticallyAdjustKeyboardInsets": true, "automaticallyAdjustsScrollIndicatorInsets": true, "bounces": true, "bouncesZoom": true, "canCancelContentTouches": true, "centerContent": true, "contentInset": { "diff": "[Function pointsDiffer]" }, "contentInsetAdjustmentBehavior": true, "directionalLockEnabled": true, "indicatorStyle": true, "inverted": true, "keyboardDismissMode": true, "maintainVisibleContentPosition": true, "maximumZoomScale": true, "minimumZoomScale": true, "onMomentumScrollBegin": true, "onMomentumScrollEnd": true, "onScroll": true, "onScrollBeginDrag": true, "onScrollEndDrag": true, "onScrollToTop": true, "pinchGestureEnabled": true, "scrollEventThrottle": true, "scrollIndicatorInsets": { "diff": "[Function pointsDiffer]" }, "scrollToOverflowEnabled": true, "scrollsToTop": true, "showsHorizontalScrollIndicator": true, "zoomScale": true } }, "unequal": [] } ``` Changelog: [Internal] Reviewed By: yungsters Differential Revision: D32225225 fbshipit-source-id: 0f236256dcbcab4fe66165b5e36df2b5f785d94e
1 parent 76613ec commit 9022849

File tree

1 file changed

+133
-68
lines changed

1 file changed

+133
-68
lines changed

Libraries/Components/ScrollView/ScrollViewNativeComponent.js

Lines changed: 133 additions & 68 deletions
Original file line numberDiff line numberDiff line change
@@ -11,75 +11,140 @@
1111
import type {ScrollViewNativeProps as Props} from './ScrollViewNativeComponentType';
1212
import type {HostComponent} from '../../Renderer/shims/ReactNativeTypes';
1313
import * as NativeComponentRegistry from '../../NativeComponent/NativeComponentRegistry';
14+
import Platform from '../../Utilities/Platform';
15+
16+
const RCTScrollViewViewConfig =
17+
Platform.OS === 'android'
18+
? {
19+
uiViewClassName: 'RCTScrollView',
20+
bubblingEventTypes: {},
21+
directEventTypes: {
22+
topMomentumScrollBegin: {
23+
registrationName: 'onMomentumScrollBegin',
24+
},
25+
topMomentumScrollEnd: {
26+
registrationName: 'onMomentumScrollEnd',
27+
},
28+
topScroll: {
29+
registrationName: 'onScroll',
30+
},
31+
topScrollBeginDrag: {
32+
registrationName: 'onScrollBeginDrag',
33+
},
34+
topScrollEndDrag: {
35+
registrationName: 'onScrollEndDrag',
36+
},
37+
},
38+
validAttributes: {
39+
contentOffset: {
40+
diff: require('../../Utilities/differ/pointsDiffer'),
41+
},
42+
decelerationRate: true,
43+
disableIntervalMomentum: true,
44+
pagingEnabled: true,
45+
scrollEnabled: true,
46+
showsVerticalScrollIndicator: true,
47+
snapToAlignment: true,
48+
snapToEnd: true,
49+
snapToInterval: true,
50+
snapToOffsets: true,
51+
snapToStart: true,
52+
borderBottomLeftRadius: true,
53+
borderBottomRightRadius: true,
54+
sendMomentumEvents: true,
55+
borderRadius: true,
56+
nestedScrollEnabled: true,
57+
borderStyle: true,
58+
borderRightColor: {process: require('../../StyleSheet/processColor')},
59+
borderColor: {process: require('../../StyleSheet/processColor')},
60+
borderBottomColor: {
61+
process: require('../../StyleSheet/processColor'),
62+
},
63+
persistentScrollbar: true,
64+
endFillColor: {process: require('../../StyleSheet/processColor')},
65+
fadingEdgeLength: true,
66+
overScrollMode: true,
67+
borderTopLeftRadius: true,
68+
scrollPerfTag: true,
69+
borderTopColor: {process: require('../../StyleSheet/processColor')},
70+
removeClippedSubviews: true,
71+
borderTopRightRadius: true,
72+
borderLeftColor: {process: require('../../StyleSheet/processColor')},
73+
},
74+
}
75+
: {
76+
uiViewClassName: 'RCTScrollView',
77+
bubblingEventTypes: {},
78+
directEventTypes: {
79+
topMomentumScrollBegin: {
80+
registrationName: 'onMomentumScrollBegin',
81+
},
82+
topMomentumScrollEnd: {
83+
registrationName: 'onMomentumScrollEnd',
84+
},
85+
topScroll: {
86+
registrationName: 'onScroll',
87+
},
88+
topScrollBeginDrag: {
89+
registrationName: 'onScrollBeginDrag',
90+
},
91+
topScrollEndDrag: {
92+
registrationName: 'onScrollEndDrag',
93+
},
94+
topScrollToTop: {
95+
registrationName: 'onScrollToTop',
96+
},
97+
},
98+
validAttributes: {
99+
alwaysBounceHorizontal: true,
100+
alwaysBounceVertical: true,
101+
automaticallyAdjustContentInsets: true,
102+
automaticallyAdjustKeyboardInsets: true,
103+
automaticallyAdjustsScrollIndicatorInsets: true,
104+
bounces: true,
105+
bouncesZoom: true,
106+
canCancelContentTouches: true,
107+
centerContent: true,
108+
contentInset: {
109+
diff: require('../../Utilities/differ/insetsDiffer'),
110+
},
111+
contentOffset: {
112+
diff: require('../../Utilities/differ/pointsDiffer'),
113+
},
114+
contentInsetAdjustmentBehavior: true,
115+
decelerationRate: true,
116+
directionalLockEnabled: true,
117+
disableIntervalMomentum: true,
118+
indicatorStyle: true,
119+
inverted: true,
120+
keyboardDismissMode: true,
121+
maintainVisibleContentPosition: true,
122+
maximumZoomScale: true,
123+
minimumZoomScale: true,
124+
pagingEnabled: true,
125+
pinchGestureEnabled: true,
126+
scrollEnabled: true,
127+
scrollEventThrottle: true,
128+
scrollIndicatorInsets: {
129+
diff: require('../../Utilities/differ/insetsDiffer'),
130+
},
131+
scrollToOverflowEnabled: true,
132+
scrollsToTop: true,
133+
showsHorizontalScrollIndicator: true,
134+
showsVerticalScrollIndicator: true,
135+
snapToAlignment: true,
136+
snapToEnd: true,
137+
snapToInterval: true,
138+
snapToOffsets: true,
139+
snapToStart: true,
140+
zoomScale: true,
141+
},
142+
};
14143

15144
const ScrollViewNativeComponent: HostComponent<Props> =
16-
NativeComponentRegistry.get<Props>('RCTScrollView', () => ({
17-
uiViewClassName: 'RCTScrollView',
18-
bubblingEventTypes: {},
19-
directEventTypes: {
20-
topScrollToTop: {
21-
registrationName: 'onScrollToTop',
22-
},
23-
},
24-
validAttributes: {
25-
alwaysBounceHorizontal: true,
26-
alwaysBounceVertical: true,
27-
automaticallyAdjustContentInsets: true,
28-
automaticallyAdjustKeyboardInsets: true,
29-
automaticallyAdjustsScrollIndicatorInsets: true,
30-
bounces: true,
31-
bouncesZoom: true,
32-
canCancelContentTouches: true,
33-
centerContent: true,
34-
contentInset: {
35-
diff: require('../../Utilities/differ/pointsDiffer'),
36-
},
37-
contentOffset: {
38-
diff: require('../../Utilities/differ/pointsDiffer'),
39-
},
40-
contentInsetAdjustmentBehavior: true,
41-
decelerationRate: true,
42-
directionalLockEnabled: true,
43-
disableIntervalMomentum: true,
44-
endFillColor: {
45-
process: require('../../StyleSheet/processColor'),
46-
},
47-
fadingEdgeLength: true,
48-
indicatorStyle: true,
49-
inverted: true,
50-
keyboardDismissMode: true,
51-
maintainVisibleContentPosition: true,
52-
maximumZoomScale: true,
53-
minimumZoomScale: true,
54-
nestedScrollEnabled: true,
55-
onMomentumScrollBegin: true,
56-
onMomentumScrollEnd: true,
57-
onScroll: true,
58-
onScrollBeginDrag: true,
59-
onScrollEndDrag: true,
60-
onScrollToTop: true,
61-
overScrollMode: true,
62-
pagingEnabled: true,
63-
persistentScrollbar: true,
64-
pinchGestureEnabled: true,
65-
scrollEnabled: true,
66-
scrollEventThrottle: true,
67-
scrollIndicatorInsets: {
68-
diff: require('../../Utilities/differ/pointsDiffer'),
69-
},
70-
scrollPerfTag: true,
71-
scrollToOverflowEnabled: true,
72-
scrollsToTop: true,
73-
sendMomentumEvents: true,
74-
showsHorizontalScrollIndicator: true,
75-
showsVerticalScrollIndicator: true,
76-
snapToAlignment: true,
77-
snapToEnd: true,
78-
snapToInterval: true,
79-
snapToOffsets: true,
80-
snapToStart: true,
81-
zoomScale: true,
82-
},
83-
}));
145+
NativeComponentRegistry.get<Props>(
146+
'RCTScrollView',
147+
() => RCTScrollViewViewConfig,
148+
);
84149

85150
export default ScrollViewNativeComponent;

0 commit comments

Comments
 (0)