Repository navigation
Commit c24d41a
committed
Lay out multiline TextInput lines without the font's leading on iOS
React Native measures text with NSLayoutManager.usesFontLeading set to
NO (since #27195), so a multiline TextInput is sized for lines of
ascender + descender. RCTUITextView kept UIKit's default and laid its
lines out with the font's leading on top. For a font with leading, the
text then didn't fit the measured view: with Hiragino Sans at 16 pt each
line took 24 pt instead of 16 pt, the view scrolled, its first line was
cut off and the selection highlight was a line and a half tall. An
explicit lineHeight didn't prevent it.
Turn the font's leading off in RCTUITextView too, on its
NSTextLayoutManager, or on its NSLayoutManager where UIKit uses TextKit
1. Fonts without leading, such as the system font, lay out as before.1 parent bfea95f commit c24d41a
1 file changed
Lines changed: 10 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
58 | 58 | | |
59 | 59 | | |
60 | 60 | | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
61 | 71 | | |
62 | 72 | | |
63 | 73 | | |
| |||
0 commit comments