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.

maxHeight incorrect

See original GitHub issue

Hey @FaridSafi !

Awesome job on this chat ! 👏

I’m having an issue with the size of the chat, the Input is taking most of the screen sometimes (Screenshot below).

After investigating it looks like the height returned by onLayout is 0 here. The correct height is returned on a second call of onLayout, I’ve managed to fix the issue just by adding if (layout.height <= 0) return; that way the correct height will be used on the next call.

Are you aware of this issue ? Does it seem like the right way to fix it ? I can push you a PR with the fix if you want to 👍

Thanks

IMG_2184.jpg

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:12 (4 by maintainers)

github_iconTop GitHub Comments

2reactions
emirdelizcommented, Aug 25, 2016

I fix my problem with this

<Container>
    <Header>
        <Button transparent onPress={ () => this.props.navigate.pop() }>
             <Icon name="ios-arrow-back" />
        </Button>
        <Title>{ this.props.professional.name }</Title>
    </Header>
    <View>
        <GiftedChat messages={ this.state.messages } renderActions={ this.buildCustomActions }
            onSend={ this.onSend } user={{ _id: 1}} />
    </View>
</Container>

The cause of problem is tag Content

2reactions
maxs15commented, Aug 24, 2016

There is just a basic <GiftedChat user={this.props.user} locale={locale} messages={this.props.messages}/> in my view. But I’m using react-native-navigation to manage navigation between my views. It may be the cause of the layout recalculation… but I think it’s a good thing to handle the case where the layout would change because the chat becomes unusable otherwise

Read more comments on GitHub >

github_iconTop Results From Across the Web

max-height - CSS: Cascading Style Sheets - MDN Web Docs
The max-height CSS property sets the maximum height of an element. It prevents the used value of the height property from becoming larger ......
Read more >
CSS max-height not working - Stack Overflow
Unfortunately, the max-height doesn't seem to work. What am I doing wrong? I am using IE7. html · css.
Read more >
max-height - CSS-Tricks
The max-height property in CSS is used to set the maximum height of a specified element. Authors may use any of the length...
Read more >
The css propery "max-height" is not applied on element when ...
Why hen I use max-height: 20% -as precents, is not applied on the element, ... the problem is only with "max-height". when I...
Read more >
Instructional Staff Turnover and Vacancy (District Totals)
... and miscellaneous categories has been updated to reflect removal of administrators and education specialists incorrectly coded to these categories.
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