Multiple Swipe Left required to swipe Left
ravi123saxena opened this issue · 2 comments
HI,
I have horizontal gallery and when swipe left it not happens in one swipe . I need multiple swipe to get it work.
Please look into the issue.
<GestureRecognizer
onSwipeLeft={() => {
let currentPosition = this.state.currentPosition;
if (this.state.alreadyVoted == true) {
currentPosition = this.state.nextVotingPosition
}
if (currentPosition < this.state.contentList.length - 1) {
this.setState({
currentPosition: currentPosition + 1,
contentId: this.state.contentList[currentPosition + 1],
alreadyVoted: false
})
console.log('Displaying next item - ', currentPosition)
} else {
console.log('No more items to display!!')
this.setState({
currentPosition: currentPosition + 1,
alreadyVoted: false
})
}
this.saveLastViewedContentForCampaign(
this.state.campaignId,
currentPosition + 1)
}}
config={{
detectSwipeUp: false,
detectSwipeDown: false,
detectSwipeRight: false,
velocityThreshold: 0.3,
directionalOffsetThreshold: 80
}}>{this.renderGallery(tabVerticalStyles)}
</GestureRecognizer>
@dpk89 did you find any solution ?
Did you find a solution for this?
I am using some custom code. I have attached the source code.
UseCase:
<SwipeGesture style={this.isLandscapeAsset() ?
phoneStyles.vote2GalleryContainerLandscape :
phoneStyles.vote2GalleryContainer}
onSwipePerformed={this.onSwipePerformed}
>
{this.renderGallery(phoneStyles)}