Skip to content

Commit 211ea48

Browse files
janicduplessisfacebook-github-bot
authored andcommitted
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: #26432 Test Plan: Tested the fix in an app. Before ![image](https://user-images.githubusercontent.com/2677334/64898120-f1de0600-d653-11e9-97b3-f53416d5f9fe.png) After ![image](https://user-images.githubusercontent.com/2677334/64897961-5b114980-d653-11e9-8897-baa14fc0f56c.png) Reviewed By: mdvacca, mmmulani Differential Revision: D17468767 Pulled By: JoshuaGross fbshipit-source-id: ae29debf9a57198a636a24ec8ed9ba3d77f0a73e
1 parent 8b9f790 commit 211ea48

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

ReactAndroid/src/main/java/com/facebook/react/views/textinput/ReactTextInputManager.java

+5
Original file line numberDiff line numberDiff line change
@@ -248,6 +248,11 @@ public void setFontStyle(ReactEditText view, @Nullable String fontStyle) {
248248
view.setFontStyle(fontStyle);
249249
}
250250

251+
@ReactProp(name = ViewProps.INCLUDE_FONT_PADDING, defaultBoolean = true)
252+
public void setIncludeFontPadding(ReactEditText view, boolean includepad) {
253+
view.setIncludeFontPadding(includepad);
254+
}
255+
251256
@ReactProp(name = "importantForAutofill")
252257
public void setImportantForAutofill(ReactEditText view, @Nullable String value) {
253258
int mode = View.IMPORTANT_FOR_AUTOFILL_AUTO;

0 commit comments

Comments
 (0)