machadogj / react-native-carousel-control

React Native Carousel control with support for iOS and Android
MIT License
247 stars 55 forks source link

support RTL #27

Closed ahmedoid closed 7 years ago

ahmedoid commented 7 years ago

ScrollView in RTL devices don't work

<View style={[ styles.container, this.props.containerStyle ]}>
                <ScrollView
                    automaticallyAdjustContentInsets={ false }
                    bounces
                    contentContainerStyle={ [ computedStyles.scrollView ] }
                     style={{ flexDirection: I18nManager.isRTL ? 'row-reverse' : 'row' }}
                    decelerationRate={ 0.9 }
                    horizontal
                    onScrollEndDrag={ this._handleScrollEnd }
                    ref={ c => this.scrollView = c }
                    showsHorizontalScrollIndicator={ false }
                >
                    { body }
                </ScrollView>
            </View>

add this line work perfect in RTL

style={{ flexDirection: I18nManager.isRTL ? 'row-reverse' : 'row' }}

machadogj commented 7 years ago

@ahmedoid awesome point! thanks for the help 👍

machadogj commented 7 years ago

This has been published in v1.1.2!