From 02005973ee5ed3b4d31b6c5c2dffb660c74bccaa Mon Sep 17 00:00:00 2001 From: Joshua Gross Date: Mon, 5 Oct 2020 14:34:26 -0700 Subject: [PATCH] Fix sloppy boolean error that breaks certain Fabric TextInputs Summary: When I landed D24042677 (https://github.com/facebook/react-native/commit/030d2c1931fb9ff97f682343914503a1c359e1c4), I had the right idea in spirit but forgot to negate the if statement. Oops. This means that in non-Fabric, the cached spannable will be updated (potentially causing a crash) and the cached spannable will *never* be updated, meaning that most TextInputs will be measured as 0 in Fabric. Changelog: [Internal] Reviewed By: sammy-SC Differential Revision: D24119952 fbshipit-source-id: dc86137956535e1f2b147bb432d050b3561e2658 --- .../java/com/facebook/react/views/textinput/ReactEditText.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ReactAndroid/src/main/java/com/facebook/react/views/textinput/ReactEditText.java b/ReactAndroid/src/main/java/com/facebook/react/views/textinput/ReactEditText.java index b5312d28ae5..f11daf378fc 100644 --- a/ReactAndroid/src/main/java/com/facebook/react/views/textinput/ReactEditText.java +++ b/ReactAndroid/src/main/java/com/facebook/react/views/textinput/ReactEditText.java @@ -943,7 +943,7 @@ public class ReactEditText extends AppCompatEditText */ private void updateCachedSpannable(boolean resetStyles) { // Noops in non-Fabric - if (mFabricViewStateManager.hasStateWrapper()) { + if (!mFabricViewStateManager.hasStateWrapper()) { return; } // If this view doesn't have an ID yet, we don't have a cache key, so bail here