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.

[Text] Text doesn't wrap

See original GitHub issue

http://puu.sh/i407j/805ec722a0.png Text doesn’t wrap when it’s wrapped inside :

msgReceivedAlignContainer: {
    flex: 1,
    flexDirection: 'column',
    alignItems: 'flex-w',
  },

Issue Analytics

  • State:closed
  • Created 8 years ago
  • Comments:29 (1 by maintainers)

github_iconTop GitHub Comments

133reactions
a11y1337commented, Sep 13, 2016

Hey there @mvnnn, I was able to get this to work by adding a ‘flex: 1’ property to the text element. Hopefully it works in your situation, as well.

<View style={{flexDirection:'row'}}> <Text style={{flex: 1, flexWrap: 'wrap'}}> You miss fdddddd dddddddd You miss fdddddd dddddddd</Text> </View>

90reactions
dwiltcommented, Feb 9, 2017

I tried @a11y1337 's method and it didn’t work for me. I have a situation where I have text sitting in a View along side of another View and the text is running through the parent’s padding and out of the parent’s container:

image

Markup:

<View style={styles.container}>
    <AlbumCover
        image={album_cover}
        width={smallAlbumCover}
        height={smallAlbumCover}
        borderRadius={6}
    />
    <View style={styles.info}>
        <Text style={styles.title} allowFontScaling={false}>{title}</Text>
        <Text style={styles.author} allowFontScaling={false}>{author}</Text>
    </View>
</View>

Styles:

export default StyleSheet.create({
    container: {
        flexDirection: 'row',
        alignItems: 'center',
    },
    info: {
        flexGrow: 1,
        marginLeft: gutter,
    },
    title: {
        fontSize: 16,
        fontFamily: sansSerifLight,
        color: nearlyBlack,
    },
    author: {
        fontSize: 12,
        fontFamily: sansSerif,
        color: greyishBrown,
    }
});

As I said, I tried all of the the suggestions here and nothing seemed to work. WHAT DID WORK was adding a width: 0 to the info style:

info: {
    width: 0,
    flexGrow: 1,
    marginLeft: gutter,
},

and voilà:

image

Read more comments on GitHub >

github_iconTop Results From Across the Web

CSS Text doesn't wrap? - Stack Overflow
I'm developing a web app and in one of the <div>s on my page, the text doesn't wrap, instead it just overflows.
Read more >
Wrapping and breaking text - CSS: Cascading Style Sheets
Wrapping and breaking text. This guide explains the various ways in which overflowing text can be managed in CSS.
Read more >
Text Doesn't Wrap at Margin in Draft View - Word Ribbon Tips
Text Doesn't Wrap at Margin in Draft View · Display the Word Options dialog box. · Click Advanced at the left side of...
Read more >
Text won't wrap - Microsoft Community
8), when I insert text into a particular row, it won't wrap. Text wraps properly in other rows. i have tried Format Cells...
Read more >
4 causes for text wrap misbehavior - CreativePro Network
1. Has the image been flipped or rotated? · 2. Has the text wrap been applied to the image, or the image frame?...
Read more >

github_iconTop Related Medium Post

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