From 4ad76b6eb2ad7d9b06ead86a07c25c194916d1d7 Mon Sep 17 00:00:00 2001 From: Nick Gerleman Date: Fri, 20 Feb 2026 15:35:25 -0800 Subject: [PATCH] PreparedLayoutTextView: Don't show a selection highlight when tapping on links Summary: With [origins](https://github.com/facebook/litho/blob/55e28e58930a53133620fd32406ec8c3a9116c0c/litho-rendercore-text/src/main/java/com/facebook/rendercore/text/RCTextView.java#L525) in Litho's `RCTextView`, tapping a link in a `PreparedLayoutTextView` will select the link (as if keyboarding to it), before activating click, then clearing selection. D86657563 made all pressable text links, so now we show a new native selection highlight in a lot of places. {F1985802566} That's a visual difference compared to before, that I am concerned might be breaking. This diff removes it, but I could be convinced it should stay. Like for keyboarding in old and new TextViews, it is using the existing `selectionColor` prop (falling back to native theme). Changelog: [Internal] Reviewed By: cortinico Differential Revision: D93820112 fbshipit-source-id: 46fe33fccce0b75131f8d6dcf4aef1d175e6f3d4 --- .../com/facebook/react/views/text/PreparedLayoutTextView.kt | 5 ----- 1 file changed, 5 deletions(-) diff --git a/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/views/text/PreparedLayoutTextView.kt b/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/views/text/PreparedLayoutTextView.kt index 7799a958e1f..1b4e659a2a8 100644 --- a/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/views/text/PreparedLayoutTextView.kt +++ b/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/views/text/PreparedLayoutTextView.kt @@ -209,11 +209,6 @@ internal class PreparedLayoutTextView(context: Context) : ViewGroup(context), Re if (clickableSpan !is ReactLinkSpan) { clickableSpan.onClick(this) } - } else if (action == MotionEvent.ACTION_DOWN) { - val layout = checkNotNull(preparedLayout).layout - val start = (layout.text as Spanned).getSpanStart(clickableSpan) - val end = (layout.text as Spanned).getSpanEnd(clickableSpan) - setSelection(start, end) } return true