mirror of
https://github.com/facebook/react-native.git
synced 2026-11-18 20:19:07 +00:00
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
This commit is contained in:
1 parent
7de3dbe1c8
commit
4ad76b6eb2
1 file changed
-5
-5
@@ -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
|
||||
|
||||
Reference in new issue
Block a user