|
19 | 19 | import android.text.method.LinkMovementMethod;
|
20 | 20 | import android.text.util.Linkify;
|
21 | 21 | import android.view.Gravity;
|
| 22 | +import android.view.MotionEvent; |
22 | 23 | import android.view.View;
|
23 | 24 | import android.view.ViewGroup;
|
24 | 25 | import androidx.annotation.Nullable;
|
|
31 | 32 | import com.facebook.react.bridge.WritableArray;
|
32 | 33 | import com.facebook.react.bridge.WritableMap;
|
33 | 34 | import com.facebook.react.common.ReactConstants;
|
| 35 | +import com.facebook.react.config.ReactFeatureFlags; |
34 | 36 | import com.facebook.react.uimanager.PixelUtil;
|
35 | 37 | import com.facebook.react.uimanager.ReactCompoundView;
|
36 | 38 | import com.facebook.react.uimanager.UIManagerModule;
|
@@ -382,6 +384,16 @@ public int reactTagForTouch(float touchX, float touchY) {
|
382 | 384 | return target;
|
383 | 385 | }
|
384 | 386 |
|
| 387 | + @Override |
| 388 | + public boolean onTouchEvent(MotionEvent ev) { |
| 389 | + // The root view always assumes any view that was tapped wants the touch |
| 390 | + // and sends the event to JS as such. |
| 391 | + // We don't need to do bubbling in native (it's already happening in JS). |
| 392 | + // For an explanation of bubbling and capturing, see |
| 393 | + // http://javascript.info/tutorial/bubbling-and-capturing#capturing |
| 394 | + return ReactFeatureFlags.enableNestedTextOnPressEventFix; |
| 395 | + } |
| 396 | + |
385 | 397 | @Override
|
386 | 398 | protected boolean verifyDrawable(Drawable drawable) {
|
387 | 399 | if (mContainsImages && getText() instanceof Spanned) {
|
|
0 commit comments