-
Notifications
You must be signed in to change notification settings - Fork 24.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
alignItems: 'baseline' doesn't work #15858
Comments
There is a workaround to this. If you wrap sibling |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Maybe the issue has been fixed in a recent release, or perhaps it is not affecting a lot of people. If you think this issue should definitely remain open, please let us know why. Thank you for your contributions. |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Maybe the issue has been fixed in a recent release, or perhaps it is not affecting a lot of people. If you think this issue should definitely remain open, please let us know why. Thank you for your contributions. |
I recently fixed this on iOS. |
Thanks for posting this! It looks like you may not be using the latest version of React Native, v0.53.0, released on January 2018. Can you make sure this issue can still be reproduced in the latest version? I am going to close this, but please feel free to open a new issue if you are able to confirm that this is still a problem in v0.53.0 or newer. |
this bug still exists... |
react-native/RNTester/js/TextExample.ios.js Lines 226 to 276 in 0366349
|
@shergin on Android this bug still exists...,
Environment
my package.json is
the Code is import React, { PureComponent } from 'react';
import { Text, View, StyleSheet } from 'react-native';
export default class TestTextBaseline extends PureComponent {
render() {
return (
<View style={styles.container}>
<View style={styles.textContainer}>
<Text style={{ fontSize: 65, backgroundColor: '#ff9c6e' }}>1</Text>
<Text style={{ fontSize: 55, backgroundColor: '#ff9c6e' }}>1</Text>
<Text style={{ fontSize: 45, backgroundColor: '#ff9c6e' }}>1</Text>
<Text style={{ fontSize: 35, backgroundColor: '#ff9c6e' }}>1</Text>
<Text style={{ fontSize: 25, backgroundColor: '#ff9c6e' }}>1</Text>
</View>
</View>
);
}
}
export const styles = StyleSheet.create({
container: {
flex: 1,
justifyContent: 'center',
alignItems: 'center'
},
textContainer: {
justifyContent: 'center',
flexDirection: 'row',
alignItems: 'baseline'
}
}); ios is correct |
I'm on RN 0.59.10 and it's not working on android yet. I get the same result that @MrSeaWave getting. |
In many cases we cannot apple the workaround by wrapping all Texts inside Text, for example in making a table. |
Is 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/AThen, 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
{flexDirection: 'row', alignItems:'baseline'}
fontSize
sExpected 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)
The text was updated successfully, but these errors were encountered: