From 05e8ff1fe06772a9e9e86d816444ba5c0ee814a8 Mon Sep 17 00:00:00 2001 From: Denis Koroskin Date: Thu, 28 Jan 2016 17:36:14 -0800 Subject: [PATCH] Remove bogus assert Summary: There is an assert in FlatViewGroup.reactTagForTouch() that says that TouchTargetHelper should not allow returning getId() when pointer events are BOX_NONE. This is not entirely accurate. This acturally method is invoked in 2 different contexts. Main context is to find a touch target, and in that context the method indeed should never return getId() if pointer events are BOX_NONE. There is however a TouchTargetHelper which actually expects that reactTagForTouch() *may* return getId(), in which case it will perform logic to not all this method be invoked again from main context. In other words, this assert needs to be removed because it is entirely possible to return getId() when pointer events are BOX_NONE. Ideally, these would be 2 different methods, but ReactCompoundView interface only defines a single reactTagForTouch() method. Reviewed By: ahmedre Differential Revision: D2873931 --- .../src/main/java/com/facebook/react/flat/FlatViewGroup.java | 4 ---- 1 file changed, 4 deletions(-) diff --git a/ReactAndroid/src/main/java/com/facebook/react/flat/FlatViewGroup.java b/ReactAndroid/src/main/java/com/facebook/react/flat/FlatViewGroup.java index ce1c1c5705..6ff83f607f 100644 --- a/ReactAndroid/src/main/java/com/facebook/react/flat/FlatViewGroup.java +++ b/ReactAndroid/src/main/java/com/facebook/react/flat/FlatViewGroup.java @@ -129,10 +129,6 @@ import com.facebook.react.views.image.ImageLoadEvent; } } - SoftAssertions.assertCondition( - mPointerEvents != PointerEvents.BOX_NONE, - "TouchTargetHelper should not allow returning getId() when pointer events are BOX_NONE"); - // no children found return getId(); }