Skip to content

Commit 850efc5

Browse files
committed
Fix issue when vertical gesture conflict with ScrollView in main container
1 parent bd61ab9 commit 850efc5

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

index.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -244,7 +244,7 @@ export default class Drawer extends Component {
244244
this._panning = false
245245
this.shouldOpenDrawer(gestureState.dx) ? this.open() : this.close()
246246
};
247-
247+
248248
onStartShouldSetPanResponderCapture = (e, gestureState) => {
249249
if (this.shouldCaptureGestures()) return this.processShouldSet(e, gestureState)
250250
return false
@@ -294,6 +294,8 @@ export default class Drawer extends Component {
294294
processShouldSet = (e, gestureState) => {
295295
let inMask = this.testPanResponderMask(e, gestureState)
296296
if (!inMask) return false
297+
// skip gesture process if we have mostly vertical swipe
298+
if (Math.abs(gestureState.dy) >= Math.abs(gestureState.dx)) return false
297299
this._panStartTime = Date.now()
298300
if (inMask && this.shouldCaptureGestures()) return true
299301
if (this.props.negotiatePan) return false
@@ -398,7 +400,7 @@ export default class Drawer extends Component {
398400
if(typeof type === 'function') {
399401
type() // this is actually a callback
400402
} else cb && cb()
401-
403+
402404
}
403405
})
404406
};

0 commit comments

Comments
 (0)