Multiline TextInput Does Not Respect Line-Height
See original GitHub issueDescription
Related to #4977
TextInput with multiline={true}
and line-height set on the value text should respect the line height value, but does not.
import React from 'react';
import {
registerComponent,
} from 'react-native-playground';
import {
StatusBar,
StyleSheet,
Text,
View,
TextInput,
} from 'react-native';
class App extends React.Component {
render() {
const loremText = "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Quisque quis lacinia sapien, in bibendum est. "
return (
<View style={styles.container}>
<Text style={styles.lorem}>
{loremText}
</Text>
<TextInput style={[styles.lorem,styles.input]} multiline={true} value={loremText} />
<StatusBar barStyle="default" />
</View>
);
}
}
const styles = StyleSheet.create({
container: {
flex: 1,
justifyContent: 'center',
alignItems: 'center',
backgroundColor: '#d3c012',
},
lorem: {
textAlign: 'left',
color: '#000',
fontSize: 19,
marginBottom: 5,
lineHeight: 50,
},
input: {
marginTop: 50,
padding: 5,
height: 150,
width: 300,
borderColor: 'purple',
borderWidth: 2,
}
});
This issue can be seen here: https://rnplay.org/apps/TYBoBw
Additional Information
- React Native version: 0.36
- Platform: both iOS, Android
- Operating System: MacOS
Issue Analytics
- State:
- Created 7 years ago
- Reactions:16
- Comments:18 (8 by maintainers)
Top Results From Across the Web
Am I misunderstanding React Native's TextInput multiline and ...
I assumed that using TextInput's multiline and numberOfLines properties like this would work, but alas when I reach row 5, the textBox just ......
Read more >[TextInput] lineHeight in multiline TextInput - React Native
[TextInput] lineHeight in multiline TextInput. mkonicek. Moved from https://github.com/facebook/react-native/issues/1577.
Read more >Can a single line text box be changed to a multiline ... - Quora
No, you cannot make a single-line text input behave like a multi-line textbox (i.e. allow line breaks support scrolling and resizing) with CSS....
Read more ><Input /> | Widget API - Figma
Typing Enter blurs the input and triggers onTextEditEnd . On overflow, the text will wrap to the next line and the height of...
Read more >Flexible, Multi-Line, Bulletproof Buttons - Litmus
Flexible, Multi-Line, Bulletproof Buttons ... The mso-flex-btn class does not seem to work in this example : ... [if gte mso 9]> /v:textbox...
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 FreeTop 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
Top GitHub Comments
For temp solution, I wrap
<Text/>
in<TextInput/>
. Make sure the<TextInput/>
doesn’t specifyvalue
props.Any updates on this? on 0.46.0 running on iOS. still having issues.