Commit acf0eb1
committed
fix(ios): re-seed paragraphStyle on typed TextInput text so baseline offset applies
The prior Fabric fix calls RCTApplyBaselineOffset on the incoming
attributedString in _setAttributedString, but on each keystroke the
attributedText that round-trips UIKit → Fabric state → back drops
NSParagraphStyleAttributeName: UIKit's typingAttributes does not carry
the paragraph style, and _updateState stores the stripped attributedText
verbatim as an OpaquePointer in TextInputState.
Without a paragraph style on the incoming string,
RCTApplyBaselineOffsetForRange reads maximumLineHeight == 0 and returns
early, so NSBaselineOffsetAttributeName never lands on typed text and
glyphs end up pinned to the bottom of the paragraphStyle-sized line box.
Re-seed the paragraph style from defaultTextAttributes on any range that
lacks it (or carries a zero-lineHeight stub) before calling the helper,
so the baseline offset is computed and applied.1 parent 4c1c231 commit acf0eb1
1 file changed
Lines changed: 20 additions & 0 deletions
File tree
- packages/react-native/React/Fabric/Mounting/ComponentViews/TextInput
Lines changed: 20 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
768 | 768 | | |
769 | 769 | | |
770 | 770 | | |
| 771 | + | |
| 772 | + | |
| 773 | + | |
| 774 | + | |
| 775 | + | |
| 776 | + | |
| 777 | + | |
| 778 | + | |
| 779 | + | |
| 780 | + | |
| 781 | + | |
| 782 | + | |
| 783 | + | |
| 784 | + | |
| 785 | + | |
| 786 | + | |
| 787 | + | |
| 788 | + | |
| 789 | + | |
| 790 | + | |
771 | 791 | | |
772 | 792 | | |
773 | 793 | | |
| |||
0 commit comments