@@ -189,6 +189,7 @@ class Drawer extends Component {
189189 return false
190190 } ;
191191
192+ // @TODO using shouldCaptureGestures in pan responder may be obsolete now that we have overlay
192193 shouldCaptureGestures = ( ) => {
193194 if ( this . props . captureGestures === true ) return true
194195 if ( this . props . captureGestures === 'closed' && this . _open === false ) return true
@@ -212,11 +213,16 @@ class Drawer extends Component {
212213 } ;
213214
214215 handleMoveShouldSetPanResponderCapture = ( e , gestureState ) => {
215- if ( this . shouldCaptureGestures ( ) && this . props . negotiatePan ) return this . handleMoveShouldSetPanResponder ( e , gestureState )
216+ if ( this . shouldCaptureGestures ( ) && this . props . negotiatePan ) return this . processMoveShouldSet ( e , gestureState )
216217 return false
217218 } ;
218219
219220 handleMoveShouldSetPanResponder = ( e , gestureState ) => {
221+ if ( ! this . shouldCaptureGestures ( ) && this . props . negotiatePan ) return this . processMoveShouldSet ( e , gestureState )
222+ return false
223+ } ;
224+
225+ processMoveShouldSet = ( e , gestureState ) => {
220226 let inMask = this . testPanResponderMask ( e , gestureState )
221227 if ( ! inMask ) return false
222228 if ( ! this . props . acceptPan ) return false
@@ -374,7 +380,7 @@ class Drawer extends Component {
374380 style = { [ this . stylesheet . main , { height : this . getHeight ( ) , width : this . getMainWidth ( ) } ] }
375381 >
376382 { this . props . children }
377- { this . shouldCaptureGestures ( )
383+ { this . captureGestures !== false
378384 ? < View
379385 ref = { c => this . mainOverlay = c }
380386 style = { styles . mainOverlay }
@@ -497,6 +503,7 @@ class Drawer extends Component {
497503 if ( didRotationChange ) this . _syncAfterUpdate = true
498504 viewport = viewport || this . state . viewport
499505 props = props || this . props
506+ // @TODO code should be methodized and shared with similar calls
500507 this . _offsetClosed = props . closedDrawerOffset % 1 === 0 ? props . closedDrawerOffset : props . closedDrawerOffset * viewport . width
501508 this . _offsetOpen = props . openDrawerOffset % 1 === 0 ? props . openDrawerOffset : props . openDrawerOffset * viewport . width
502509 this . setState ( { viewport } )
0 commit comments