A framework for building native applications using React
fix(ios): Fix rounding error occurring randomly in iOS text line height calculation (#54260)
Summary: Fixes issue https://github.com/facebook/react-native/issues/53450 There are some discussion and explanation about the issue here: https://github.com/facebook/react-native/issues/53450#issuecomment-3298157830 In short, there seems to be a rounding error occurring with the new architecture's implementation when the text paragraph line heights are calculated on iOS, that happens randomly and depends on what text content the view has, and on the device screen. The fix is basically the same that had been implemented in the React Native's [old architecture 8 years ago](https://github.com/facebook/react-native/commit/a534672e132136e7bbd17c94a7f4e67149bcc67a), but hasn't been brought into the new architecture implementation. The fix adds a fraction to the text line dimensions to mitigate the rounding error. ## Changelog: [IOS] [FIXED] - Fix rounding error occurring randomly in iOS text line height calculation Pull Request resolved: https://github.com/facebook/react-native/pull/54260 Test Plan: Note that the reproduction of the issue is also dependant on the used device/simulator, this was tested using the iPhone 17 simulator. - Go to Text Layout Example in the RNTester app - Scroll down the text until you see this text paragraph: Without the fix: <img width="400" alt="without-the-fix" src="https://github.com/user-attachments/assets/9a1fe071-be39-4f99-a7e6-25c2fb431fa4" /> With the fix: <img width="400" alt="with-the-fix" src="https://github.com/user-attachments/assets/eb798afc-1d39-4464-a21a-07d95db8ce62" /> Reviewed By: javache Differential Revision: D85438723 Pulled By: cipolleschi fbshipit-source-id: f1b2890ce5341fda790f5689ab1291b69cf7595b
P
Pekka Soutua committed
581d643a9e59fd88f93757f80194e1efd11bd0e5
Parent: ee7575f
Committed by meta-codesync[bot] <215208954+meta-codesync[bot]@users.noreply.github.com>
on 11/10/2025, 6:22:11 PM