react-native-carousel
react-native-carousel copied to clipboard
Carousel doesn't use the correct width for indicators
When specifying a custom width and pressing on an indicator, the scrollTo doesn't use the given width prop (I think instead using the width defined from Dimensions at the top of the file).
I think the quickest fix would be to just change this:
indicatorPressed(activePage){
this.setState({activePage});
this.refs.scrollView.scrollTo(0, activePage * width);
},
to this:
indicatorPressed(activePage){
this.setState({activePage});
this.refs.scrollView.scrollTo(0, activePage * this.props.width);
},
I'm happy to open a PR for it instead if wanted.