File tree Expand file tree Collapse file tree 1 file changed +8
-6
lines changed
src/incubator/WheelPicker Expand file tree Collapse file tree 1 file changed +8
-6
lines changed Original file line number Diff line number Diff line change @@ -97,7 +97,7 @@ const WheelPicker = ({
97
97
labelStyle,
98
98
labelProps,
99
99
onChange,
100
- align,
100
+ align = WheelPickerAlign . CENTER ,
101
101
style,
102
102
children,
103
103
initialValue,
@@ -181,13 +181,13 @@ const WheelPicker = ({
181
181
} ,
182
182
[ onChange ] ) ;
183
183
184
- const alignmentStyle = useMemo ( ( ) =>
185
- align === WheelPickerAlign . RIGHT
186
- ? { alignSelf : 'flex-end' }
184
+ const alignmentStyle = useMemo ( ( ) => {
185
+ return align === WheelPickerAlign . RIGHT
186
+ ? { alignSelf : undefined }
187
187
: align === WheelPickerAlign . LEFT
188
188
? { alignSelf : 'flex-start' }
189
- : { alignSelf : 'center' } ,
190
- [ align ] ) ;
189
+ : { alignSelf : 'center' } ;
190
+ } , [ align ] ) ;
191
191
192
192
const renderItem = useCallback ( ( { item, index} ) => {
193
193
return (
@@ -283,6 +283,8 @@ const WheelPicker = ({
283
283
getItemLayout = { getItemLayout }
284
284
initialScrollIndex = { currentIndex }
285
285
onContentSizeChange = { updateFlatListWidth }
286
+ /* This fixes an issue with RTL when centering flatlist content using alignSelf */
287
+ centerContent = { align === 'center' && Constants . isRTL }
286
288
/>
287
289
</ View >
288
290
</ View >
You can’t perform that action at this time.
0 commit comments