Commit f87adab
committed
fix(ios): center TextInput placeholder when lineHeight > fontSize
The placeholder in RCTUITextField and RCTUITextView inherits the
paragraph style from defaultTextAttributes, so it suffers the same
bottom-anchor misalignment as typed text when lineHeight > fontSize.
Apply the equivalent NSBaselineOffsetAttributeName in
_placeholderTextAttributes so the placeholder renders at the same
vertical position as typed text.
These backing views are shared between Paper and Fabric, so this
also fixes the placeholder on the old arch (where facebook#38359 only
addressed typed text).1 parent 58e909b commit f87adab
2 files changed
Lines changed: 12 additions & 0 deletions
File tree
- packages/react-native/Libraries/Text/TextInput
- Multiline
- Singleline
Lines changed: 6 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
364 | 364 | | |
365 | 365 | | |
366 | 366 | | |
| 367 | + | |
| 368 | + | |
| 369 | + | |
| 370 | + | |
| 371 | + | |
| 372 | + | |
367 | 373 | | |
368 | 374 | | |
369 | 375 | | |
| |||
Lines changed: 6 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
169 | 169 | | |
170 | 170 | | |
171 | 171 | | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
| 177 | + | |
172 | 178 | | |
173 | 179 | | |
174 | 180 | | |
| |||
0 commit comments