-
Notifications
You must be signed in to change notification settings - Fork 515
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add ability to configure movement threshold #23
Comments
I started working on it in my fork, managed to make it work on Android already. I'll clean the code and push it tomorrow and we can talk about the feature and it's api before I go on to implement it for iOS. |
Hi, there's actually an example of a https://github.com/wix/react-native-interactable/blob/master/example/src/HandleTouches.js This is actually the example we use to test some cases of touches hell. There is an external ScrollView which can be scrolled vertically and inside Interactables that can be dragged horizontally. And inside buttons with TouchableOpacity that can be tapped. Fun! The way it was resolved on iOS is with gesture recognizers. This was the commit where I fixed the touches problems in this example: ec6be42 Regarding the issue of taps of contained buttons happening even if you drag, the main trick was to cancel the touch events sent to JS. It's done in the commit in the Also, if you make changes, make sure to test this example before and after and see that it behaves the same way. Conflicting touches are complicated as hell :) |
Oh I didn't find that example since I was looking at the I only found |
I continued to test the feature with the examples and realized it wasn't really preventing clicks when it should, only worked in my use case because of some specific circumstances. Also realized this wasn't really the feature I was missing here, so I'm closing this issue and try to settle on what's missing in my use case to make it work properly. |
Regarding the example you ran on Android with the touches: You said that you ran it on Android and it didn't work.. if so we should take care of it because it's supposed to work on Android (it was working when originally implemented). If the example is not working, you should reopen the issue or create a new one for this. |
i know this is closed, but is it possible for panResponder and Interactible.View to work together? (see #80 ) I'm trying to detect a 2-finger pinch with panResponder but also drag with Interactible.View. |
I'm currently facing a similar issue only on Android. When I press a touchable inside an Interactable.View it's never fired. It looks like the views are way more sensitive in Android and I have to press very straight and without moving my finger. |
#187 (comment) check this out , may it would help |
First of all, amazing work. I was dealing with a lot of pain with dragging things in RN and currently trying to use Interactable instead. So far it looks excellent, except for one thing.
I have a draggable view that is tappable in some of it's areas. I looked through the examples and noticed you don't have an example of a
Touchable
inside anInteractable.View
.I tried it and it's rather hard to tap my buttons with it.
Before this solution I used
PanResponder
and was able to work through this issue by defining a threshold to distinguish between a drag and any other touch with something like this:I would imagine a nice api for that would just be some
sensitivityThreshold
prop that accepts a number or something similar.Edit:
I've gathered a bit more information - looks like my taps are happening even if I drag, but because I'm not using the native driver (throws some exception atm) it happens after a couple of seconds of latency.
I'm guessing the cause of the latency is that the touch leave is queued after all the touch movement had been handled, although it seems to be handled perfectly on the spot but the
onPress
is still triggered at least a whole second after I stopped dragging.Ideally I would like to prevent dragging inside my threshold and let it go through to my touchables, but if it is considered a drag - the touches shouldn't propagate to these touchables.
The text was updated successfully, but these errors were encountered: