Skip to content
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Fix to get proper index value
  • Loading branch information
AdityaPahilwani committed Jun 28, 2021
commit ac1f6b2aa0cb88f1019d17be1b524aff48fe044d
8 changes: 4 additions & 4 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -476,10 +476,10 @@ export default class extends Component {
}
}
}

if (this.props.showAdjacentViews && this.state.dir === 'x') {
e.nativeEvent.contentOffset.x = e.nativeEvent.contentOffset.x - (3 * this.internals.adjacentViewDiffWidth)
}
// It breaks index values with greater adjacentWidth and padding
// if (this.props.showAdjacentViews && this.state.dir === 'x') {
// e.nativeEvent.contentOffset.x = e.nativeEvent.contentOffset.x - (3 * this.internals.adjacentViewDiffWidth)
// }

this.updateIndex(e.nativeEvent.contentOffset, this.state.dir, () => {
this.autoplay()
Expand Down