mirror of
https://github.com/facebook/react-native.git
synced 2025-11-01 09:14:26 +00:00
Fix includeFontPadding for TextInput placeholder (#26432)
Summary:
The custom font I'm using requires using `includeFontPadding={false}` to be correctly centered vertically. The only case where this is not working is with the placeholder of `TextInput`. To fix it we call `setIncludeFontPadding` on the `EditText` instance, like we do for `Text`.
## Changelog
[Android] [Fixed] - Fix `includeFontPadding` for `TextInput` placeholder
Pull Request resolved: https://github.com/facebook/react-native/pull/26432
Test Plan:
Tested the fix in an app.
Before

After

Reviewed By: mdvacca, mmmulani
Differential Revision: D17468767
Pulled By: JoshuaGross
fbshipit-source-id: ae29debf9a57198a636a24ec8ed9ba3d77f0a73e
This commit is contained in:
committed by
Facebook Github Bot
parent
8b9f790069
commit
211ea485cd
+5
@@ -248,6 +248,11 @@ public class ReactTextInputManager extends BaseViewManager<ReactEditText, Layout
|
||||
view.setFontStyle(fontStyle);
|
||||
}
|
||||
|
||||
@ReactProp(name = ViewProps.INCLUDE_FONT_PADDING, defaultBoolean = true)
|
||||
public void setIncludeFontPadding(ReactEditText view, boolean includepad) {
|
||||
view.setIncludeFontPadding(includepad);
|
||||
}
|
||||
|
||||
@ReactProp(name = "importantForAutofill")
|
||||
public void setImportantForAutofill(ReactEditText view, @Nullable String value) {
|
||||
int mode = View.IMPORTANT_FOR_AUTOFILL_AUTO;
|
||||
|
||||
Reference in New Issue
Block a user