diff --git a/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/views/scroll/ReactHorizontalScrollView.kt b/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/views/scroll/ReactHorizontalScrollView.kt index 4cfef027d0eb..a53cb4b274f4 100644 --- a/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/views/scroll/ReactHorizontalScrollView.kt +++ b/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/views/scroll/ReactHorizontalScrollView.kt @@ -62,6 +62,7 @@ import com.facebook.react.views.scroll.ReactScrollViewHelper.SNAP_ALIGNMENT_DISA import com.facebook.react.views.scroll.ReactScrollViewHelper.SNAP_ALIGNMENT_END import com.facebook.react.views.scroll.ReactScrollViewHelper.SNAP_ALIGNMENT_START import com.facebook.react.views.scroll.ReactScrollViewHelper.findNextFocusableView +import com.facebook.react.views.view.ImportantForInteractionHelper import com.facebook.systrace.Systrace import kotlin.math.abs import kotlin.math.ceil @@ -175,6 +176,11 @@ constructor(context: Context, private val fpsListener: FpsListener? = null) : private var pendingContentOffsetX = UNSET_CONTENT_OFFSET private var pendingContentOffsetY = UNSET_CONTENT_OFFSET public open var pointerEvents: PointerEvents = PointerEvents.AUTO + set(value) { + field = value + ImportantForInteractionHelper.setImportantForInteraction(this, value, _overflow) + } + private var contentView: View? = null private var maintainVisibleContentPositionHelper: MaintainVisibleScrollPositionHelper? = @@ -425,6 +431,7 @@ constructor(context: Context, private val fpsListener: FpsListener? = null) : else Overflow.SCROLL, ) } + ImportantForInteractionHelper.setImportantForInteraction(this, pointerEvents, _overflow) invalidate() } diff --git a/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/views/scroll/ReactNestedScrollView.kt b/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/views/scroll/ReactNestedScrollView.kt index fb7ca3352f65..d4db73d704b1 100644 --- a/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/views/scroll/ReactNestedScrollView.kt +++ b/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/views/scroll/ReactNestedScrollView.kt @@ -4,7 +4,7 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @generated SignedSource<<1ad8f84ac759d8d225ce0fd57dccea7b>> + * @generated SignedSource<<21f8ac172eefdbfa94cab925e21d7a99>> */ /** @@ -64,6 +64,7 @@ import com.facebook.react.views.scroll.ReactScrollViewHelper.SNAP_ALIGNMENT_DISA import com.facebook.react.views.scroll.ReactScrollViewHelper.SNAP_ALIGNMENT_END import com.facebook.react.views.scroll.ReactScrollViewHelper.SNAP_ALIGNMENT_START import com.facebook.react.views.scroll.ReactScrollViewHelper.findNextFocusableView +import com.facebook.react.views.view.ImportantForInteractionHelper import com.facebook.systrace.Systrace import kotlin.math.abs import kotlin.math.ceil @@ -112,6 +113,10 @@ constructor(context: Context, private val fpsListener: FpsListener? = null) : override var hasChildPressedStateDelay: Boolean? = null public open var pointerEvents: PointerEvents = PointerEvents.AUTO + set(value) { + field = value + ImportantForInteractionHelper.setImportantForInteraction(this, value, _overflow) + } public open var fadingEdgeLengthStart: Int = 0 set(value) { @@ -393,6 +398,7 @@ constructor(context: Context, private val fpsListener: FpsListener? = null) : else Overflow.SCROLL, ) } + ImportantForInteractionHelper.setImportantForInteraction(this, pointerEvents, _overflow) invalidate() } diff --git a/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/views/scroll/ReactScrollView.kt b/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/views/scroll/ReactScrollView.kt index c478bdfe98cb..0de62ed814a9 100644 --- a/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/views/scroll/ReactScrollView.kt +++ b/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/views/scroll/ReactScrollView.kt @@ -56,6 +56,7 @@ import com.facebook.react.views.scroll.ReactScrollViewHelper.SNAP_ALIGNMENT_DISA import com.facebook.react.views.scroll.ReactScrollViewHelper.SNAP_ALIGNMENT_END import com.facebook.react.views.scroll.ReactScrollViewHelper.SNAP_ALIGNMENT_START import com.facebook.react.views.scroll.ReactScrollViewHelper.findNextFocusableView +import com.facebook.react.views.view.ImportantForInteractionHelper import com.facebook.systrace.Systrace import kotlin.math.abs import kotlin.math.ceil @@ -104,6 +105,10 @@ constructor(context: Context, private val fpsListener: FpsListener? = null) : override var hasChildPressedStateDelay: Boolean? = null public open var pointerEvents: PointerEvents = PointerEvents.AUTO + set(value) { + field = value + ImportantForInteractionHelper.setImportantForInteraction(this, value, _overflow) + } public open var fadingEdgeLengthStart: Int = 0 set(value) { @@ -385,6 +390,7 @@ constructor(context: Context, private val fpsListener: FpsListener? = null) : else Overflow.SCROLL, ) } + ImportantForInteractionHelper.setImportantForInteraction(this, pointerEvents, _overflow) invalidate() } diff --git a/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/views/text/PreparedLayoutTextViewManager.kt b/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/views/text/PreparedLayoutTextViewManager.kt index 6e80c1252e5a..b91e3037fb59 100644 --- a/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/views/text/PreparedLayoutTextViewManager.kt +++ b/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/views/text/PreparedLayoutTextViewManager.kt @@ -21,6 +21,7 @@ import com.facebook.react.uimanager.IViewGroupManager import com.facebook.react.uimanager.LayoutShadowNode import com.facebook.react.uimanager.LengthPercentage import com.facebook.react.uimanager.LengthPercentageType +import com.facebook.react.uimanager.PointerEvents import com.facebook.react.uimanager.ReactStylesDiffMap import com.facebook.react.uimanager.ReferenceStateWrapper import com.facebook.react.uimanager.StateWrapper @@ -33,6 +34,7 @@ import com.facebook.react.uimanager.style.BorderStyle import com.facebook.react.uimanager.style.LogicalEdge import com.facebook.react.uimanager.style.Overflow import com.facebook.react.views.text.ReactTextViewAccessibilityDelegate.AccessibilityLinks +import com.facebook.react.views.view.ImportantForInteractionHelper import java.util.HashMap @ReactModule(name = PreparedLayoutTextViewManager.REACT_CLASS) @@ -109,6 +111,12 @@ internal class PreparedLayoutTextViewManager : @ReactProp(name = "overflow") fun setOverflow(view: PreparedLayoutTextView, overflow: String?): Unit { view.overflow = Overflow.fromString(overflow) + ImportantForInteractionHelper.setImportantForInteraction( + view, + // has no pointerEvents prop, so it always behaves as AUTO. + PointerEvents.AUTO, + view.overflow, + ) } @ReactProp(name = "accessible") diff --git a/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/views/text/ReactTextView.java b/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/views/text/ReactTextView.java index 9f1af516e311..c20f271bb512 100644 --- a/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/views/text/ReactTextView.java +++ b/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/views/text/ReactTextView.java @@ -676,4 +676,8 @@ public void setOverflow(@Nullable String overflow) { mOverflow = Overflow.fromString(overflow); invalidate(); } + + /* package */ Overflow getOverflow() { + return mOverflow; + } } diff --git a/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/views/text/ReactTextViewManager.kt b/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/views/text/ReactTextViewManager.kt index 1079916b74c9..8bc1eafb2f0e 100644 --- a/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/views/text/ReactTextViewManager.kt +++ b/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/views/text/ReactTextViewManager.kt @@ -31,6 +31,7 @@ import com.facebook.react.uimanager.IViewManagerWithChildren import com.facebook.react.uimanager.LayoutShadowNode import com.facebook.react.uimanager.LengthPercentage import com.facebook.react.uimanager.LengthPercentageType +import com.facebook.react.uimanager.PointerEvents import com.facebook.react.uimanager.ReactStylesDiffMap import com.facebook.react.uimanager.ReferenceStateWrapper import com.facebook.react.uimanager.StateWrapper @@ -44,6 +45,7 @@ import com.facebook.react.uimanager.style.BorderStyle.Companion.fromString import com.facebook.react.uimanager.style.LogicalEdge import com.facebook.react.views.text.DefaultStyleValuesUtil.getDefaultTextColorHighlight import com.facebook.react.views.text.ReactTypefaceUtils.getFontWeightAdjustment +import com.facebook.react.views.view.ImportantForInteractionHelper import java.util.HashMap /** View manager for `` nodes. */ @@ -236,6 +238,12 @@ public constructor( @ReactProp(name = "overflow") public fun setOverflow(view: ReactTextView, overflow: String?) { view.setOverflow(overflow) + ImportantForInteractionHelper.setImportantForInteraction( + view, + // has no pointerEvents prop, so it always behaves as AUTO. + PointerEvents.AUTO, + view.overflow, + ) } @ReactProp(name = "accessible") diff --git a/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/views/textinput/ReactEditText.kt b/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/views/textinput/ReactEditText.kt index b2a31c84019c..fa1e43b8463c 100644 --- a/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/views/textinput/ReactEditText.kt +++ b/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/views/textinput/ReactEditText.kt @@ -140,7 +140,9 @@ public open class ReactEditText public constructor(context: Context) : AppCompat private var didAttachToWindow = false private var selectTextOnFocus = false private var placeholder: String? = null - private var overflow = Overflow.VISIBLE + internal var overflow = Overflow.VISIBLE + private set + private var wasMultiline = false public var stateWrapper: StateWrapper? = null diff --git a/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/views/textinput/ReactTextInputManager.kt b/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/views/textinput/ReactTextInputManager.kt index 5ff43109dc69..736c411c402a 100644 --- a/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/views/textinput/ReactTextInputManager.kt +++ b/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/views/textinput/ReactTextInputManager.kt @@ -46,6 +46,7 @@ import com.facebook.react.uimanager.BaseViewManager import com.facebook.react.uimanager.LayoutShadowNode import com.facebook.react.uimanager.LengthPercentage import com.facebook.react.uimanager.LengthPercentageType +import com.facebook.react.uimanager.PointerEvents import com.facebook.react.uimanager.ReactStylesDiffMap import com.facebook.react.uimanager.StateWrapper import com.facebook.react.uimanager.ThemedReactContext @@ -73,6 +74,7 @@ import com.facebook.react.views.text.ReactTypefaceUtils.getFontWeightAdjustment import com.facebook.react.views.text.ReactTypefaceUtils.parseFontVariant import com.facebook.react.views.text.TextAttributeProps import com.facebook.react.views.text.TextLayoutManager +import com.facebook.react.views.view.ImportantForInteractionHelper import java.util.LinkedList /** Manages instances of TextInput. */ @@ -882,6 +884,12 @@ public open class ReactTextInputManager public constructor() : @ReactProp(name = "overflow") public fun setOverflow(view: ReactEditText, overflow: String?) { view.setOverflow(overflow) + ImportantForInteractionHelper.setImportantForInteraction( + view, + // has no pointerEvents prop, so it always behaves as AUTO. + PointerEvents.AUTO, + view.overflow, + ) } override fun onAfterUpdateTransaction(view: ReactEditText) {