requireExternalGestureToFail and blocksExternalGesture don't work reliably #3326
Labels
Platform: Android
This issue is specific to Android
Platform: iOS
This issue is specific to iOS
Repro provided
A reproduction with a snack or repo is provided
Description
Continuing my adventures with these APIs.
I have three gestures:
Here's how I want them to work:
This is proving quite tricky.
Example 1: Broken (
requireExternalGestureToFail
in parent)Let's start with this baseline code:
Here, I'm declaring that the inner ScrollView should take precedence over Pan:
However, this doesn't work. Neither on iOS nor on Android:
bug-1.mov
Example 2: Broken (
blocksExternalGesture
in parent)Okay, now let's try to express the relationship in the reverse:
(Full snippet)
This also doesn't work, neither on iOS nor on Android:
bug-2.mov
Example 3: Works (
blocksExternalGesture
in child)Now let's move the
innerNative
declaration down the component chain.We'll remove it here:
and add it here:
(Full snippet)
Now it works!
finally.mov
Conclusions
To sum up:
requireExternalGestureToFail
in the parent didn't work (both platforms)blocksExternalGesture
in the parent didn't work either (both platforms)blocksExternalGesture
in the child did work (both platforms)This is with 2.20.2 + #3322 applied.
I wanted to test this with 2.22.0 but I couldn't get even the most basic view running locally because of some error about "unknown view tag" while rendering
GestureDetector
.That said, this Snack (Example 1) is running 2.22.0-rc.1 and does reproduce the first issue, at least on Android. And this Snack (Example 2) reproduces the second issue. So I think, at least for Android, the bug is present in the latest.
Steps to reproduce
Snack or a link to a repository
https://snack.expo.dev/mzHvgIje0N9z2MuCjQfqW?platform=android
Gesture Handler version
2.22.0-rc.1
React Native version
0.76.3
Platforms
Android, iOS
JavaScript runtime
Hermes
Workflow
Expo bare workflow
Architecture
Paper (Old Architecture)
Build type
Debug mode
Device
Android emulator
Device model
No response
Acknowledgements
Yes
The text was updated successfully, but these errors were encountered: