diff --git a/android/plugins/litho/src/main/java/com/facebook/flipper/plugins/litho/DebugComponentDescriptor.java b/android/plugins/litho/src/main/java/com/facebook/flipper/plugins/litho/DebugComponentDescriptor.java index 761218041..05ed3fae1 100644 --- a/android/plugins/litho/src/main/java/com/facebook/flipper/plugins/litho/DebugComponentDescriptor.java +++ b/android/plugins/litho/src/main/java/com/facebook/flipper/plugins/litho/DebugComponentDescriptor.java @@ -367,6 +367,7 @@ public class DebugComponentDescriptor extends NodeDescriptor { @Override public void hitTest(DebugComponent node, Touch touch) { + boolean finish = true; for (int i = getChildCount(node) - 1; i >= 0; i--) { final Object child = getChildAt(node, i); if (child instanceof DebugComponent) { @@ -375,17 +376,17 @@ public class DebugComponentDescriptor extends NodeDescriptor { if (touch.containedIn(bounds.left, bounds.top, bounds.right, bounds.bottom)) { touch.continueWithOffset(i, bounds.left, bounds.top); - return; + finish = false; } } else if (child instanceof View || child instanceof Drawable) { // Components can only mount one view or drawable and its bounds are the same as the // hosting component. touch.continueWithOffset(i, 0, 0); - return; + finish = false; } } - touch.finish(); + if (finish) touch.finish(); } @Override diff --git a/android/plugins/litho/src/main/java/com/facebook/flipper/plugins/litho/DebugSectionDescriptor.java b/android/plugins/litho/src/main/java/com/facebook/flipper/plugins/litho/DebugSectionDescriptor.java index b10c809c9..882c4992d 100644 --- a/android/plugins/litho/src/main/java/com/facebook/flipper/plugins/litho/DebugSectionDescriptor.java +++ b/android/plugins/litho/src/main/java/com/facebook/flipper/plugins/litho/DebugSectionDescriptor.java @@ -171,7 +171,7 @@ public class DebugSectionDescriptor extends NodeDescriptor { // For a DiffSectionSpec, check if child view to see if the touch is in its bounds. // For a GroupSectionSpec, check the bounds of the entire section. - + boolean finish = true; if (node.isDiffSectionSpec()) { for (int i = 0; i < childCount; i++) { View child = (View) getChildAt(node, i); @@ -183,10 +183,9 @@ public class DebugSectionDescriptor extends NodeDescriptor { final boolean hit = touch.containedIn(left, top, right, bottom); if (hit) { touch.continueWithOffset(i, left, top); - return; + finish = false; } } - touch.finish(); } else { for (int i = 0; i < childCount; i++) { DebugSection child = (DebugSection) getChildAt(node, i); @@ -194,11 +193,11 @@ public class DebugSectionDescriptor extends NodeDescriptor { final boolean hit = touch.containedIn(bounds.left, bounds.top, bounds.right, bounds.bottom); if (hit) { touch.continueWithOffset(i, 0, 0); - return; + finish = false; } } - touch.finish(); } + if (finish) touch.finish(); } @Override