react-native-carousel icon indicating copy to clipboard operation
react-native-carousel copied to clipboard

Carousel doesn't use the correct width for indicators

Open Draydrew opened this issue 9 years ago • 0 comments

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.

Draydrew avatar Feb 12 '16 16:02 Draydrew