Skip to content

Commit

Permalink
Fix auto swipe
Browse files Browse the repository at this point in the history
  • Loading branch information
Michaelvilleneuve committed Feb 13, 2020
1 parent 8c15164 commit 0bde89f
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,8 @@ export default class Gallery extends Component {
goTo = index => {
this.sendCurrentImageInfo(this.props.data[index]);
this.setState({ index });
this.swiper.scrollToIndex({
index: Number(index)
this.swiper.scrollToOffset({
offset: Dimensions.get("window").width * index
});
};

Expand Down Expand Up @@ -110,6 +110,7 @@ const styles = {
},
flatList: {
flex: 1,
width: Dimensions.get("window").width,
alignSelf: "stretch"
},
loader: {
Expand Down

0 comments on commit 0bde89f

Please sign in to comment.