Skip to content

Commit 4ad76b6

Browse files
NickGerlemanmeta-codesync[bot]
authored andcommitted
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
1 parent 7de3dbe commit 4ad76b6

1 file changed

Lines changed: 0 additions & 5 deletions

File tree

packages/react-native/ReactAndroid/src/main/java/com/facebook/react/views/text/PreparedLayoutTextView.kt

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -209,11 +209,6 @@ internal class PreparedLayoutTextView(context: Context) : ViewGroup(context), Re
209209
if (clickableSpan !is ReactLinkSpan) {
210210
clickableSpan.onClick(this)
211211
}
212-
} else if (action == MotionEvent.ACTION_DOWN) {
213-
val layout = checkNotNull(preparedLayout).layout
214-
val start = (layout.text as Spanned).getSpanStart(clickableSpan)
215-
val end = (layout.text as Spanned).getSpanEnd(clickableSpan)
216-
setSelection(start, end)
217212
}
218213

219214
return true

0 commit comments

Comments
 (0)