-
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
lineHeight not distributed evenly in TextInput #39145
Comments
|
This also applies to |
The best workaround I have so far is to not set |
After some more testing it seems the issue is limited to iOS. Both web and Android look correct. |
Any other information I can provide to clarify the issue? |
So far unresolved! @shergin @mdvacca @sammy-SC @cortinico @RSNara @cortinico @yungsters @NickGerleman |
This issue is stale because it has been open 180 days with no activity. Remove stale label or comment or this will be closed in 7 days. |
This is still an issue. |
I can also reproduce it. Problem affects only iOS and only https://snack.expo.dev/@adamfromattio/ios-problem-with-lineheight?platform=ios |
Just came across this. Thought maybe #46362 fixes it, but issue is still there. Tested on Can be reproduced with: import {StyleSheet, Text, TextInput, View} from 'react-native';
function App() {
return (
<View style={{justifyContent: 'center', flex: 1}}>
<View style={styles.container}>
<TextInput value="Type something" style={styles.text} />
</View>
<View style={styles.container}>
<Text style={styles.text}>Type something</Text>
</View>
</View>
);
}
const styles = StyleSheet.create({
container: {
backgroundColor: 'gray',
padding: 16,
},
text: {
backgroundColor: 'white',
fontSize: 16,
lineHeight: 1.52 * 16,
color: 'black',
padding: 0,
},
});
export default App; |
any update here? is this being worked on? |
#46362 is gated right now for testing, we will open it up soon |
Description
When you have a
TextInput
withlineHeight
>fontSize
the remaining space isn't distributed evenly around the text. For example:Result:
All the extra space in the
TextInput
case is on top of the text, making it hard to vertically alignTextInput
s (e.g. with aText
label preceding it on the same line).React Native Version
0.71.7
Output of
npx react-native info
Steps to reproduce
Use the above snippet in the iOS simulator.
Snack, screenshot, or link to a repository
https://snack.expo.dev/UEBid9Vxh
The text was updated successfully, but these errors were encountered: