alignItems: 'baseline' doesn't work
See original GitHub issueIs this a bug report?
Yes.
Have you read the Contributing Guidelines?
Yes.
Environment
react-native -v
: 0.48.1node -v
: v7.9.0npm -v
: 5.4.1yarn --version
: N/A
Then, specify:
-
Target Platform: iOS, Android
-
Development Operating System: macOS Sierra 10.12.5
-
Build tools:
react-native run-ios
react-native run-android
Steps to Reproduce
- Create a wrapper view with the styles:
{flexDirection: 'row', alignItems:'baseline'}
- Within the wrapper view, create multiple text nodes with different
fontSize
s
Expected Behavior
The text nodes would be aligned along the baseline.
Actual Behavior
The text nodes are not aligned along the baseline. The alignment is indistinguishable from alignItems: 'flex-end'
Reproducible Demo
https://snack.expo.io/HkoJ_QkcZ
(T16975579)
Issue Analytics
- State:
- Created 6 years ago
- Reactions:4
- Comments:11 (3 by maintainers)
Top Results From Across the Web
CSS display:flex align-items:baseline not working in Firefox
my children elements align properly in Chrome and Safari but in Firefox they are aligned at the bottom and don't seems to have...
Read more >align-items: baseline not working with nested flex containers.
Issues in Layout that do not fit into any other Layout component or which span multiple Layout components. Bugs related to the top...
Read more >What's the deal with align-items: baseline? - Maxwell Antonucci
My site has shown that having varying text or elements around a baseline can create lots of empty space.
Read more >align-items - CSS-Tricks
The align-items property is related to CSS layout. It effects how elements are aligned both in Flexbox and Grid layouts.
Read more >align-items - CSS Reference
Learn how align-items works in CSS. ... align-items: baseline;. The flexbox items are aligned at the baseline of the cross axis.
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
There is a workaround to this. If you wrap sibling
<Text>
nodes in a<Text>
everything lines up nicely regardless of the parent<View>
’salignItems
setting. https://snack.expo.io/BkR46Ub2b@shergin on Android this bug still exists…, u can see it https://github.com/facebook/react-native/issues/21918#issue-373366382
Environment
my package.json is
the Code is
ios is correct
But android is wrong