question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

TextInput breaks when text is too big

See original GitHub issue

Current behaviour

When value is too big, TextInput breaks the text as if it has the multiline prop, but doesn’t expand the container.

I noticed there is some bug on TextInput with multiline when creating the app with CRNA, which is my case. Though, I didn’t see anything related with this.

Expected behaviour

The text on the TextInput shouldn’t add another line below, just shift the content.

Code sample

<View style={styles.inputContainer}>
    <TextInput
        label={helpModalTitleLabel}
        placeholder=''
        onChangeText={(title) => this.setState({ title })}
        value={this.state.title}
        autoCorrect={true}
        keyboardType={'default'}
        autoCapitalize={'sentences'}
        style={styles.input}
    />
</View>

const styles = StyleSheet.create({
    inputContainer: {
        alignItems: 'center',
        padding: 20
    },
    input: {
        width: '100%'
    }
});

Screenshots (if applicable)

captura de tela 2018-07-18 as 08 49 08 captura de tela 2018-07-18 as 09 00 53

On this second screenshot, I wrote more than 2 lines of text.

What have you tried

Tried removing the component from inside Overlay (react-native-elements), but the bug is still there.

Your Environment

software version
ios or android ios
react-native 0.55.4
react-native-paper 1.11.0
node 8.11.2
npm or yarn npm 6.1.0

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:6 (1 by maintainers)

github_iconTop GitHub Comments

1reaction
lucasharadacommented, Jul 19, 2018

@satya164, I cleared the cache and it worked as expected. Thanks!

0reactions
joaovpmamedecommented, Aug 17, 2020

@satya164 getting the same as the others even with numberOfLines. Is this a known issue? I’m using the TextInput with mode="outlined"

Read more comments on GitHub >

github_iconTop Results From Across the Web

TextInput: long text results in linebreak #2581 - GitHub
Current behaviour Typing a long text in TextInput and unfocusing it breaks the line Expected behaviour Text is cut off at the end...
Read more >
How to use big font size properly in a low height TextInput in ...
Try creating a container to put your text input. Remove the padding horizontal and put that in the container instead of in the...
Read more >
Wrapping and breaking text - CSS: Cascading Style Sheets
This guide explains the various ways in which overflowing text can ... This property will break a word once it is too long...
Read more >
flexDirection row breaks wrap and forces content off screen
I'm experiencing a similar problem, I have a deeply nested View with row layout. Nothing fancy, just two flex:1 elements side by side....
Read more >
TextInput QML Type | Qt Quick 6.4.1
For example: if topPadding and bottomPadding are set to 10 , but the height of the TextInput is only set to 20 ,...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found