Skip to content

Commit ec31b38

Browse files
javachefacebook-github-bot
authored andcommitted
Fix bug with hittesting when skipping views due to overflow
Summary: Noticed we were sometimes receiving incorrect paths through the view hierarchy. This was largely harmless, as the hover events generated from this would still be correct. We just sometimes send more onExit/onEnter events than necessary. Changelog: [Internal] Reviewed By: rshest Differential Revision: D31434300 fbshipit-source-id: 3888270eaa16edf48f5d894a1e6daeca1ecfed1e
1 parent 37efe38 commit ec31b38

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

ReactAndroid/src/main/java/com/facebook/react/uimanager/TouchTargetHelper.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -182,7 +182,6 @@ private static View findTouchTargetView(
182182
eventCoords[0] = childPoint.x;
183183
eventCoords[1] = childPoint.y;
184184
View targetView = findTouchTargetViewWithPointerEvents(eventCoords, child, pathAccumulator);
185-
186185
if (targetView != null) {
187186
// We don't allow touches on views that are outside the bounds of an `overflow: hidden`
188187
// View
@@ -196,6 +195,9 @@ private static View findTouchTargetView(
196195
}
197196
if (inOverflowBounds) {
198197
return targetView;
198+
} else if (pathAccumulator != null) {
199+
// Not a hit, reset the path found so far
200+
pathAccumulator.clear();
199201
}
200202
}
201203
eventCoords[0] = restoreX;

0 commit comments

Comments
 (0)