Skip to content

Commit

Permalink
Fix includeFontPadding for TextInput placeholder (#26432)
Browse files Browse the repository at this point in the history
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
  • Loading branch information
janicduplessis authored and facebook-github-bot committed Sep 23, 2019
1 parent 8b9f790 commit 211ea48
Showing 1 changed file with 5 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -248,6 +248,11 @@ public void setFontStyle(ReactEditText view, @Nullable String fontStyle) {
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;
Expand Down

0 comments on commit 211ea48

Please sign in to comment.