Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix disabling swipes mid-swipe #64

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
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
fix disabling swipes mid-swipe
bmbmjmdm committed Oct 30, 2021
commit 334e720a1da57dba787fcf69067ab2746b4e9ad3
3 changes: 3 additions & 0 deletions Swiper.js
Original file line number Diff line number Diff line change
@@ -147,6 +147,7 @@ class Swiper extends Component {
}

onPanResponderMove = (event, gestureState) => {
if (!this.props.horizontalSwipe && !this.props.verticalSwipe) return
this.props.onSwiping(this._animatedValueX, this._animatedValueY)

let { overlayOpacityHorizontalThreshold, overlayOpacityVerticalThreshold } = this.props
@@ -201,6 +202,7 @@ class Swiper extends Component {
}

onPanResponderGrant = (event, gestureState) => {
if (!this.props.horizontalSwipe && !this.props.verticalSwipe) return
this.props.dragStart && this.props.dragStart()
if (!this.state.panResponderLocked) {
this.state.pan.setOffset({
@@ -216,6 +218,7 @@ class Swiper extends Component {
}

validPanResponderRelease = () => {
if (!this.props.horizontalSwipe && !this.props.verticalSwipe) return true
const {
disableBottomSwipe,
disableLeftSwipe,