From 850efc59d2c0e5cf5bfe6bf9a85621c140c2575a Mon Sep 17 00:00:00 2001 From: Max Graey Date: Mon, 16 Jan 2017 19:04:31 +0200 Subject: [PATCH 1/2] Fix issue when vertical gesture conflict with ScrollView in main container --- index.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/index.js b/index.js index 6f5dca3d..36f7157a 100644 --- a/index.js +++ b/index.js @@ -244,7 +244,7 @@ export default class Drawer extends Component { this._panning = false this.shouldOpenDrawer(gestureState.dx) ? this.open() : this.close() }; - + onStartShouldSetPanResponderCapture = (e, gestureState) => { if (this.shouldCaptureGestures()) return this.processShouldSet(e, gestureState) return false @@ -294,6 +294,8 @@ export default class Drawer extends Component { processShouldSet = (e, gestureState) => { let inMask = this.testPanResponderMask(e, gestureState) if (!inMask) return false + // skip gesture process if we have mostly vertical swipe + if (Math.abs(gestureState.dy) >= Math.abs(gestureState.dx)) return false this._panStartTime = Date.now() if (inMask && this.shouldCaptureGestures()) return true if (this.props.negotiatePan) return false @@ -398,7 +400,7 @@ export default class Drawer extends Component { if(typeof type === 'function') { type() // this is actually a callback } else cb && cb() - + } }) }; From b0c18ad77a527c434308990592d301aa2c70a60a Mon Sep 17 00:00:00 2001 From: Max Graey Date: Mon, 16 Jan 2017 19:31:06 +0200 Subject: [PATCH 2/2] Add additional change vertical gesture test --- index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/index.js b/index.js index 36f7157a..273c2a44 100644 --- a/index.js +++ b/index.js @@ -295,7 +295,7 @@ export default class Drawer extends Component { let inMask = this.testPanResponderMask(e, gestureState) if (!inMask) return false // skip gesture process if we have mostly vertical swipe - if (Math.abs(gestureState.dy) >= Math.abs(gestureState.dx)) return false + if (!this._open && Math.abs(gestureState.dy) >= Math.abs(gestureState.dx)) return false this._panStartTime = Date.now() if (inMask && this.shouldCaptureGestures()) return true if (this.props.negotiatePan) return false