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.

lineHeight in MessageText cause emojis to cut

See original GitHub issue

Issue Description

Looks like the lineHeight here https://github.com/FaridSafi/react-native-gifted-chat/blob/master/src/MessageText.js#L71 causes emojis in the top row to cut.

Removing this line seems to fix it btw.

@FaridSafi can we safely remove it or does it have a purpose?

Steps to Reproduce / Code Snippets

image

Expected Results

Not to cut 😃

Additional Information

  • Platform: iOS

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:14 (1 by maintainers)

github_iconTop GitHub Comments

6reactions
ghostcommented, Sep 22, 2016

@kfiroo Removing the lineHeight causes the bottom of emojis to cut off, when only a single line of text is present. Increasing the Line-height to (fontSize + 8) seems to solve all Emoji issues I’ve run into with React native’s text component.

For example, here setting the lineHeight to 24 (16+8) solves the problem of cutting emojis on the top and bottom.

simulator screen shot sep 21 2016 11 26 20 pm

const textStyle = {
  fontSize: 16,
  lineHeight: 24,
  marginTop: 5,
  marginBottom: 5,
  marginLeft: 10,
  marginRight: 10,
};

@FaridSafi

1reaction
kfiroocommented, Jan 29, 2017

@neilsarkar Thanks! can you post images of the same messages using the old margin style for comparison? Thanks 😃

Read more comments on GitHub >

github_iconTop Results From Across the Web

emojis are causing change in line height - Stack Overflow
You can set a fixed line-height like so: p { line-height: 20px !important; } <p>Alternatively, you can use percentages, which will be ...
Read more >
Text cut off although line spacing is sufficient
The line spacing is set to Exactly 6 pt. Although it appears that there is sufficient space for the descenders (parts of the...
Read more >
emoji cut-off - CodePen
<div class="note-body"><p>emoji on the second line, after some text ... and a line after that showing the non-emoji line spacing</p></div>.
Read more >
Emoji Line Height Incorrect - Scriptable - Automators Talk
The problem is that for some reason the line height of the emoji is not quite the same as the rest of the...
Read more >
Emoji has improper css style about `font-size` and `vertical ...
This bug cause emojis has incorrect vertical shift showed below. ... 'Noto Color Emoji'; font-size: 1.4em; line-height: 1em; } ...
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