React-native-interactable: Anchor gestures only to a specific component

Created on 14 Mar 2017  路  4Comments  路  Source: wix/react-native-interactable

Great library, this is the missing piece of Animation puzzle on React-Native!
Great job!

I have a question about handling gestures to only a specific component, in the examples like NotifPanel I saw that gestures are handled in all components wrapped by Interactable.View.
In some cases this is a desired behavior, but in this specific example it would be better that gestures are handled only by a panel footer View.

There is a way to get this behavior?

Most helpful comment

Makes sense.

There's a long similar discussion here: https://github.com/wix/react-native-interactable/issues/35

The emerging solution so far is to add another TouchBlocker component that will be able to control how touch events are handled on children. Some of the research on Android can be seen on this branch: https://github.com/wix/react-native-interactable/tree/touchBlockerBranch

If they don't reach a conclusion soon, I'll add an example for this specific scenario myself. I think we can even implement it without adding new API. I'll give it a try

All 4 comments

The idea is that what you wrap with Interactable.View becomes interactable. Meaning you can drag this whole thing around and move it and play with it.

If you just want to listen to a gesture and do something accordingly, for example move your finger on a view and change the background color accordingly - this is something this library wouldn't do well. There are other emerging solutions like react-native-gesture-handler that are designed for those specifcally.

Can you please give more info about what's the exact behavior you're trying to implement with a panel footer view? I'm not sure I understand

@talkol I think he is talking about something similar than in this situation:
image

Makes sense.

There's a long similar discussion here: https://github.com/wix/react-native-interactable/issues/35

The emerging solution so far is to add another TouchBlocker component that will be able to control how touch events are handled on children. Some of the research on Android can be seen on this branch: https://github.com/wix/react-native-interactable/tree/touchBlockerBranch

If they don't reach a conclusion soon, I'll add an example for this specific scenario myself. I think we can even implement it without adding new API. I'll give it a try

I am closing the issue as a part of an effort to cleanup and revive the project. If this issue persists after v1.0.0, you are more than welcome to reintroduce it.

Thanks for your contribution.

Was this page helpful?
0 / 5 - 0 ratings