Kureev / react-native-side-menu

Side menu component for React Native
MIT License
2.21k stars 433 forks source link

How to deal with another pan responder inside <ContentView /> #94

Closed michaltaberski closed 9 years ago

michaltaberski commented 9 years ago

Hello,

I would like to ask for advise how to deal with second pan responder I need to use inside ContentView?

I would like to keep nice pannable/swipeable character of the menu, but inside Content View I still need to have pan responder gestures.

The final resoult I would like to achive is:

ip

How should I approach it?

// EDIT

or even nicer solution would be to have:

ip2

Kureev commented 9 years ago

I think both of those behaviors are possible with this plugin. Do you have any error when you try to implement it?

michaltaberski commented 9 years ago

So my idea was to merge both functionalities:

1) the side menu 2) this tinder like animation https://github.com/brentvatne/react-native-animated-demo-tinder

In the end what I got is: http://screencast.com/t/0zU3s82piuq

It looks like the gestures are interfering each other, so I would like to know if there is a pattern to solve this kind of issues.

Kureev commented 9 years ago

I think if I would expose onStartShouldSetResponderCapture it'll solve the issue, right? You would be able to specify custom function and ignore your panResponder gestures. Am I right?

michaltaberski commented 9 years ago

I think it might help.

The solution I'm thinking about is following:

I could write custom onStartShouldSetResponderCapture function, where I check if the swipe starts on another component with panResponder (return false), or if it starts just on background (return true)

Does it make sense for you?

Kureev commented 9 years ago

That's exactly what I mean in the comment above :) I consider this as a good improvement, will try to implement it ASAP

michaltaberski commented 9 years ago

Awesome, thx.

Kureev commented 9 years ago

Exposed in 0.13.0