From 88da8d99ed936de35403b613821eba64e134b8d4 Mon Sep 17 00:00:00 2001 From: David Vacca Date: Fri, 16 Dec 2022 09:42:28 -0800 Subject: [PATCH] Fix NullPointerException occurring when using Placeholder in TextInput Summary: This diff is fixing a NullPointerException occuring when using Placeholder in TextInput. In some particular scenarios Placeholder is being updated before the TextInput is even layed out. In this diff I'm setting a defult LayoutParams to avoid NullPointerException to be thrown by android EditTextView. This change should not affect layout for TextInput components because layout will be overriden on the next Fabric commit. changelog: [internal] internal Reviewed By: fkgozali Differential Revision: D42078080 fbshipit-source-id: 294376e7f78d6ed58fc9f893553356553accba6c --- .../react/views/textinput/ReactTextInputManager.java | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/ReactAndroid/src/main/java/com/facebook/react/views/textinput/ReactTextInputManager.java b/ReactAndroid/src/main/java/com/facebook/react/views/textinput/ReactTextInputManager.java index 85fb317a2a9..f4733dfcd2b 100644 --- a/ReactAndroid/src/main/java/com/facebook/react/views/textinput/ReactTextInputManager.java +++ b/ReactAndroid/src/main/java/com/facebook/react/views/textinput/ReactTextInputManager.java @@ -26,6 +26,7 @@ import android.text.TextWatcher; import android.view.Gravity; import android.view.KeyEvent; import android.view.View; +import android.view.ViewGroup; import android.view.inputmethod.EditorInfo; import android.widget.TextView; import androidx.annotation.Nullable; @@ -189,6 +190,13 @@ public class ReactTextInputManager extends BaseViewManager