Commit 59983a5
authored
PR #3981 changed the hit-test condition in `GestureHandler.handle()`
from `view is RNGestureHandlerDetectorView` to `hostDetectorView !=
null`, which is too broad — `hostDetectorView` is set for all handler
types (regular, native, virtual, intercepting), but the detector-child
coordinate transform should only run when the handler's `view` **is**
the detector itself.
For Virtual/Intercepting handlers, the event is already in the virtual
child's coordinate space. Entering the detector branch applies a bogus
transform, breaking `x`/`y` and `isWithinBounds`.
### Fix
Added `view == detectorView` to the condition so the multi-child hit
test only runs when the handler is bound directly to the detector view:
```kotlin
// Before (broken): enters branch for all handlers with a hostDetectorView
if (detectorView != null && detectorView.isNotEmpty()) {
// After: only enters for handlers whose view IS the detector
if (detectorView != null && view == detectorView && detectorView.isNotEmpty()) {
```
Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
1 parent 1697b39 commit 59983a5
1 file changed
Lines changed: 1 addition & 1 deletion
File tree
- packages/react-native-gesture-handler/android/src/main/java/com/swmansion/gesturehandler/core
Lines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
391 | 391 | | |
392 | 392 | | |
393 | 393 | | |
394 | | - | |
| 394 | + | |
395 | 395 | | |
396 | 396 | | |
397 | 397 | | |
| |||
0 commit comments