root-two / react-native-drawer

React Native Drawer
MIT License
2.54k stars 391 forks source link

support "open" & "closed" values for acceptPan #124

Open faceyspacey opened 8 years ago

faceyspacey commented 8 years ago

When closed, you can still swipe to open the drawer. My assumption was that with captureGestures set to open, you can essentially only swipe to close it.

rt2zz commented 8 years ago

CaptureGestures refers to wether the gesture (pan or tap) is captured, effectively blocking child components from being touched.

The behaivor you are describing is controlled by acceptPan, but at present that only supports true/false. If you want to add 'open' 'closed' support to acceptPan I will accept a pr.

DavoCg commented 8 years ago

+1 it could be really useful because when tapToClose={true} and acceptPan={true}, the drawer as a strange behaviour when you swipe to close !

davidyaha commented 7 years ago

Anyone looking for a workaround If you want to disable pan mask but still capture gestures just pass negative value to the mask prop. eg. panCloseMask={-1}.

I was thinking of implementing a PR to support this better with checking acceptPan here line 300 before checking inMask and shouldCapture in line 298

@rt2zz What do you think?