From 69cbe5bcd5f907f73ca543ad1505e29fdde8efa4 Mon Sep 17 00:00:00 2001 From: David Vacca Date: Thu, 25 Jan 2024 15:31:06 -0800 Subject: [PATCH] Fix rendering of textInput using lineHeight in android API level <28 (#42673) Summary: Fix rendering of textInput using lineHeight in android API level <28 by removing call to ReactEditText.setLineHeight. ReactEditText.setLineHeight was introduced in API level 28 and we actually don't need to call this method changelog: [Internal] internal Differential Revision: D53105649 --- .../com/facebook/react/views/textinput/ReactEditText.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) 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 c4d42eb13f0d6a..39e53d255fa3df 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 @@ -273,7 +273,9 @@ public boolean onKeyUp(int keyCode, KeyEvent event) { @Override public void setLineHeight(int lineHeight) { mTextAttributes.setLineHeight(lineHeight); - super.setLineHeight(lineHeight); + if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.P) { + super.setLineHeight(lineHeight); + } } @Override