mirror of
https://github.com/facebook/react-native.git
synced 2026-11-18 20:19:07 +00:00
Summary: This PR removes extraneous blank space at the bottom of multiline `TextInput` when using nested `Text` with different font sizes on iOS with the New Architecture enabled. | Before | After | |:-:|:-:| | <img width="283" alt="Screenshot 2025-05-15 at 12 16 05" src="https://github.com/user-attachments/assets/47256267-86ff-45f9-9e60-162d444a4b9d" /> | <img width="286" alt="Screenshot 2025-05-15 at 12 01 32" src="https://github.com/user-attachments/assets/43ce4b0b-6410-4ca5-be37-59c6374ea15c" /> | The proposed solution is to call `RCTApplyBaselineOffset` separately for each line of text. Ideally, we would call it separately for each part of text with different font size. ## Changelog: [IOS] [FIXED] - Fixed blank space at the bottom of multiline TextInput on iOS Pull Request resolved: https://github.com/facebook/react-native/pull/51344 Test Plan: ```tsx <TextInput multiline style={{borderWidth: 1, width: 300, fontSize: 20}} ref={ref} placeholder="Type here..."> First line{'\n'} <Text style={{fontSize: 30, lineHeight: 60}}>Second line</Text> {'\n'}Third line{'\n'}Fourth line {'\n'} Fifth line </TextInput> ``` Reviewed By: NickGerleman Differential Revision: D74802648 Pulled By: j-piasecki fbshipit-source-id: 30f02ae8af66264c1776d241ed8542899e9cdf99