From 087193c98ead8f12ec4f839dd077d5bd63075d6f Mon Sep 17 00:00:00 2001 From: Nick Gerleman Date: Wed, 31 Jul 2024 23:49:48 -0700 Subject: [PATCH] Add missing invalidate() to `setOverflow()` (#45835) Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/45835 `ReactViewBackgroundManager` will do this for us (and otherwise doesn't do anything draw related), but this will be removed when BackgroundStyleApplicator is rolled out, and not all callers use `ReactViewBackgroundManager`. Changelog: [Android][Fixed] Reviewed By: philIip Differential Revision: D60489756 fbshipit-source-id: 37cfc2b90af057bc142ad95b93e32941edb17ca5 --- .../facebook/react/views/scroll/ReactHorizontalScrollView.java | 1 + .../java/com/facebook/react/views/scroll/ReactScrollView.java | 1 + .../main/java/com/facebook/react/views/text/ReactTextView.java | 1 + .../java/com/facebook/react/views/textinput/ReactEditText.java | 1 + 4 files changed, 4 insertions(+) diff --git a/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/views/scroll/ReactHorizontalScrollView.java b/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/views/scroll/ReactHorizontalScrollView.java index 3f377598db793a..b13f13d623bbb6 100644 --- a/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/views/scroll/ReactHorizontalScrollView.java +++ b/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/views/scroll/ReactHorizontalScrollView.java @@ -284,6 +284,7 @@ public void flashScrollIndicators() { public void setOverflow(@Nullable String overflow) { mOverflow = overflow == null ? Overflow.SCROLL : Overflow.fromString(overflow); mReactBackgroundManager.setOverflow(overflow == null ? ViewProps.SCROLL : overflow); + invalidate(); } public void setMaintainVisibleContentPosition( diff --git a/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/views/scroll/ReactScrollView.java b/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/views/scroll/ReactScrollView.java index 3873389a3cc579..7b78c7b708da92 100644 --- a/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/views/scroll/ReactScrollView.java +++ b/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/views/scroll/ReactScrollView.java @@ -272,6 +272,7 @@ public void flashScrollIndicators() { public void setOverflow(@Nullable String overflow) { mOverflow = overflow == null ? Overflow.SCROLL : Overflow.fromString(overflow); mReactBackgroundManager.setOverflow(overflow == null ? ViewProps.SCROLL : overflow); + invalidate(); } public void setMaintainVisibleContentPosition( 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 490cd6a7e148bc..277a8f4887212c 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 @@ -792,5 +792,6 @@ private void applyTextAttributes() { public void setOverflow(@Nullable String overflow) { mOverflow = overflow == null ? Overflow.VISIBLE : Overflow.fromString(overflow); mReactBackgroundManager.setOverflow(overflow); + invalidate(); } } diff --git a/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/views/textinput/ReactEditText.java b/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/views/textinput/ReactEditText.java index e5cb44905c61ae..3f1213a2ce9138 100644 --- a/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/views/textinput/ReactEditText.java +++ b/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/views/textinput/ReactEditText.java @@ -1294,6 +1294,7 @@ void setEventDispatcher(@Nullable EventDispatcher eventDispatcher) { public void setOverflow(@Nullable String overflow) { mOverflow = overflow == null ? Overflow.VISIBLE : Overflow.fromString(overflow); mReactBackgroundManager.setOverflow(overflow); + invalidate(); } @Override