Commit 9cec42c
committed
android: Make minWidth of TextInput 0 like iOS.
Currenlty TextInput on Android has some default minWidth, but on iOS
it is 0. So this commit makes TextInput width consistent on both the
platform.
On Android, if no text is present and no placeholder is provided, it's
width is 0 (assuming padding: 0 style is applied). But as soon as a
single char is entered in the input, it width becomes more than that
of char. It is no more WRAP_CONTENT. This commit fixes it.
Note: Setting backgroundColor has no affect on TextInput background
color, as background color is handled by backgroundManger.
Before:
https://user-images.githubusercontent.com/39303760/43045548-252fae7a-8dd8-11e8-8948-bb37c2b0689e.png
After:
https://user-images.githubusercontent.com/39303760/43045549-255c3bac-8dd8-11e8-8b12-30f413777544.png
Testing code:
https://github.com/jainkuniya/TestTextInput/blob/3bd6d6621d20bb6f13ede84e63e6948963febc9b/App.js1 parent e592d6f commit 9cec42c
File tree
1 file changed
+2
-0
lines changed- ReactAndroid/src/main/java/com/facebook/react/views/textinput
1 file changed
+2
-0
lines changedLines changed: 2 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
7 | 7 | | |
8 | 8 | | |
9 | 9 | | |
| 10 | + | |
10 | 11 | | |
11 | 12 | | |
12 | 13 | | |
| |||
48 | 49 | | |
49 | 50 | | |
50 | 51 | | |
| 52 | + | |
51 | 53 | | |
52 | 54 | | |
53 | 55 | | |
| |||
0 commit comments