From 628c1333eaffcccf73184205826ad77fa4c3e871 Mon Sep 17 00:00:00 2001 From: Nick Gerleman Date: Wed, 28 May 2025 15:18:33 -0700 Subject: [PATCH] Disable `hasOverlappingRendering` in PreparedLayoutTextView (#51549) Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/51549 This is copied from `ReactTextView`, with a comment explaining the shenanigans. Changelog: [Internal] Reviewed By: mdvacca Differential Revision: D75248328 fbshipit-source-id: b325cf05e0000ee0b0c5fb82f0e7412a680e5d01 --- .../com/facebook/react/views/text/PreparedLayoutTextView.kt | 5 +++++ 1 file changed, 5 insertions(+) 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 9dc06d3111d..d34a125d49a 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 @@ -278,6 +278,11 @@ internal class PreparedLayoutTextView(context: Context) : ViewGroup(context), Re return delegateHandled || super.dispatchKeyEvent(event) } + // This potentially a lie, to avoid clipping outside of layout bounds when we are translucent, at + // the cost of incorrect alpha blending. + // TODO T225199534: Add support for "needsOffscreenAlphaCompositing" to Text + override fun hasOverlappingRendering(): Boolean = false + @RequiresApi(api = Build.VERSION_CODES.UPSIDE_DOWN_CAKE) private object Api34Utils { private var highlightPaths: List? = null