From c02b5b8ad4cd756a85ea031754b7a573426f5c84 Mon Sep 17 00:00:00 2001 From: Pieter De Baets Date: Wed, 25 May 2022 03:48:32 -0700 Subject: [PATCH] Default TextInput padding to 0 in Fabric Summary: In D36345402 (https://github.com/facebook/react-native/commit/56e9aa369f5c13af38cf80ba47e9eb29d835ec89) I changed the behaviour for mount items to be skipped if they were just setting zero values. AndroidTextInput is the only component that I'm aware of that has non-zero padding by default, and we account for this when creating the native shadow node. This optimization broken TextInput use-cases that explicitly request zero-padding, since we end up ignoring it. To keep this optimization, explicitly init ReactTextInput's padding to 0, but only in Fabric. `updateState` was the closest thing I could find to a Fabric-only callback, once it's fully rolled out, we can also move this to the constructor. Changelog: [Internal] Reviewed By: JoshuaGross Differential Revision: D36545775 fbshipit-source-id: 07bb96032c69d7e350980b0b975e637b66c307ed --- .../react/views/textinput/ReactTextInputManager.java | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) 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 29411fbcae3..f3134f9cb1d 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 @@ -1273,7 +1273,16 @@ public class ReactTextInputManager extends BaseViewManager