Repository navigation
Description
Description
In a row with alignItems: 'baseline', a Text with paddingTop is placed as if it had no padding: its top lines up with the other Text's top, so its text sits lower by the padding.
Yoga reads a baseline function's answer as the distance from the node's top and passes it the node's whole width and height (calculateBaseline). ParagraphShadowNode::baseline lays the lines out in that size and returns lines[0].ascender without the top padding, while ParagraphShadowNode::layout draws the text in the content frame, below the padding. The function came in with #45102.
Steps to reproduce
-
Clone the reproducer below and run
bash ./reproduce-android.shwith an Android device on adb (it builds the app in Release, installs and launches it, and reads the log), orcd ReproducerApp && yarn install && yarn android. The app renders:<View style={{ flexDirection: 'row', alignItems: 'baseline' }}> <Text style={{ fontSize: 20 }}>A</Text> <Text style={{ fontSize: 20, paddingTop: 30, backgroundColor: '#ffe08a' }}>B</Text> </View>
-
Read the two
Texts'onLayouty values on the screen, or in logcat underReactNativeJS.
Expected: the A and the B sit on one baseline, so A's y is 30 and B's is 0.
Actual: A's y and B's y are both 0, and the B sits 30 below the A.
React Native Version
0.88.1, and 0.90.0-nightly-20261128-32260ddbe
Affected Platforms
Runtime - Android
Areas
Fabric - The New Renderer
Output of npx @react-native-community/cli info
[…]
System:
OS: Windows 11 10.0.26300
CPU: "(32) x64 AMD Ryzen 9 9950X3D 16-Core Processor "
Memory: 146.16 GB / 255.67 GB
Binaries:
Node:
version: 26.12.1
path: C:\Program Files\nodejs\node.EXE
Yarn:
version: 1.22.22
path: ~\AppData\Roaming\npm\yarn.CMD
npm:
version: 12.2.1
path: C:\Program Files\nodejs\npm.CMD
Watchman: Not Found
SDKs:
Android SDK: Not Found
Windows SDK:
AllowDevelopmentWithoutDevLicense: Enabled
Versions:
- 10.0.19041.0
- 10.0.26100.0
IDEs:
Android Studio: AI-262.9437.185.2621.16467767
Visual Studio: Not Found
Languages:
Java:
version: 17.0.20.1
path: C:\Program Files\Microsoft\jdk-17.0.20.101-hotspot\bin\javac.EXE
Ruby: Not Found
npmPackages:
"@react-native-community/cli":
installed: 20.2.0
wanted: 20.2.0
react:
installed: 19.3.0
wanted: 19.3.0
react-native:
installed: 0.88.1
wanted: 0.88.1
react-native-windows: Not Found
npmGlobalPackages:
"*react-native*": Not Found
Android:
hermesEnabled: true
newArchEnabled: true
iOS:
hermesEnabled: Not found
newArchEnabled: Not found
Stacktrace or Logs
MINGW64_NT-10.0-26300 x86_64, node v26.12.1, device SM-S911B on Android 14
react-native 0.88.1
[…]
BUILD SUCCESSFUL in 3m 16s
[…]
Text A onLayout: y=0 height=27
Text B onLayout: y=0 height=57
SUMMARY: A y=0, B y=0: the tops sit level, so B's baseline leaves out its paddingTop: 30 (expected A y=30, B y=0)
The reproducer's nightly branch, on 0.90.0-nightly-20261128-32260ddbe:
MINGW64_NT-10.0-26300 x86_64, node v26.12.1, device SM-S911B on Android 14
react-native 0.90.0-nightly-20261128-32260ddbe
[…]
BUILD SUCCESSFUL in 5m 46s
[…]
Text A onLayout: y=0 height=27
Text B onLayout: y=0 height=57
SUMMARY: A y=0, B y=0: the tops sit level, so B's baseline leaves out its paddingTop: 30 (expected A y=30, B y=0)
MANDATORY Reproducer
https://github.com/YevheniiKotyrlo/text-baseline-leaves-out-padding
Screenshots and Videos
Galaxy S23, Android 14, release build of the reproducer on 0.88.1:

Activity
ecryptoguru commentedon Nov 28, 2026
I reproduced this on an Android 17/API 37 ARM64 emulator with your unmodified release fixtures for both RN 0.88.1 and 0.90.0-nightly-20261128-32260ddbe. With 30 dp of top padding on B, both versions reported A y=0, B y=0, and B’s glyph was visibly lower. I also tried a no-padding row and a bottom-padding-only row. Both kept A and B at y=0, with the glyphs aligned. So adding height to B alone doesn’t reproduce the misalignment; the top inset matters.
Release and nightly screenshots, onLayout logs, and controls. I used the default Fabric configuration and font scale 1.0. I haven’t tested iOS. Codex assisted with the emulator checks.