Skip to content

Commit 4cdbf24

Browse files
bitsniper-aiclaude
andcommitted
fix(android): skip hidden children when finding a touch target
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
1 parent 7225d43 commit 4cdbf24

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

‎packages/react-native/ReactAndroid/src/main/java/com/facebook/react/uimanager/TouchTargetHelper.kt‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -212,6 +212,10 @@ public object TouchTargetHelper {
212212
val childrenCount = viewGroup.childCount
213213
for (i in childrenCount - 1 downTo 0) {
214214
val child = viewGroup.getChildAt(i)
215+
// A child Android would not dispatch to (ViewGroup.canViewReceivePointerEvents).
216+
if (child.visibility != View.VISIBLE && child.animation == null) {
217+
continue
218+
}
215219
val childPoint = tempPoint
216220
if (!getChildPoint(eventCoords[0], eventCoords[1], viewGroup, child, childPoint)) {
217221
// Child's transform is non-invertible (e.g. scaleX: 0 or scaleY: 0): the child is

0 commit comments

Comments
 (0)