Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Text] Emoji changes the line height #4457

Closed
h3l opened this issue Dec 1, 2015 · 22 comments
Closed

[Text] Emoji changes the line height #4457

h3l opened this issue Dec 1, 2015 · 22 comments
Labels
Resolution: Locked This issue was locked by the bot.

Comments

@h3l
Copy link

h3l commented Dec 1, 2015

The demo is here,
Emoji will change the line height.

@facebook-github-bot
Copy link
Contributor

Hey h3l, thanks for reporting this issue!

React Native, as you've probably heard, is getting really popular and truth is we're getting a bit overwhelmed by the activity surrounding it. There are just too many issues for us to manage properly.

  • If this is a feature request or a bug that you would like to be fixed by the team, please report it on Product Pains. It has a ranking feature that lets us focus on the most important issues the community is experiencing.
  • If you don't know how to do something or not sure whether some behavior is expected or a bug, please ask on StackOverflow with the tag react-native or for more real time interactions, ask on Discord in the #react-native channel.
  • We welcome clear issues and PRs that are ready for in-depth discussion; thank you for your contributions!

@satya164 satya164 changed the title [Text] Typography will not control when have a emoji. [Text] Emoji changes the line height Dec 1, 2015
@adbl
Copy link
Contributor

adbl commented Mar 13, 2016

Related to this (in iOS):

Rendering a text at fontSize 15 results in a lineheight of 18 (default font), setting the lineHeight to 18 explicitly and including an emoji will also lift up the baseline (which results in??) emoji getting cut at the top.

If there are several lines of text, an emoji on second line will fit and not get cut...

@adbl
Copy link
Contributor

adbl commented Mar 13, 2016

@h3l do you know of any workaround?

@h3l
Copy link
Author

h3l commented Mar 14, 2016

I'm sorry to tell you that there is still no solution for this.
What about to direct mention a contributor about it?

@adbl
Copy link
Contributor

adbl commented Mar 14, 2016

I found somewhat of a workaround actually... detect if the text contains any emoji and in that case apply additional style:

  emojiText: {
    fontSize: 15,
    lineHeight: 18
    marginBottom: -2,
    paddingTop: 2,
  }

Obviously it is tied to this fontSize (and font?)...

@h3l
Copy link
Author

h3l commented Mar 15, 2016

Yes, this style fix the problem in a given fontsize.
But when use change the fontsize in setting, it may have a problem.

@h3l
Copy link
Author

h3l commented Mar 15, 2016

@brentvatne Could you please have a look at this problem?

@brentvatne
Copy link
Collaborator

@h3l - sorry I had so many notifs I just noticed this. I'm not familiar with this part of the codebase but I'm noticing some strange behaviours with lineHeight on Android so looking into that..

@eugenehp
Copy link

@h3l hey Hel, do you have accounted the same issue on android platform?

@eugenehp
Copy link

@brentvatne what do you think about this? do you think this might be the good place to start finding the way to fix this interesting issue?

@adbl
Copy link
Contributor

adbl commented Oct 18, 2016

In iOS 10 the behaviour is a bit different, I think the line height no longer changes, but instead the emoji will get cut at the Text bottom margin.

@regrex
Copy link

regrex commented Nov 3, 2016

@adbl I resolved this problem by add a character, like space.

@hramos
Copy link
Contributor

hramos commented Mar 10, 2017

This is an old issue and it's not clear to me if it's still affecting people.

Please feel free to re-open, and fill in the template with details.

@hramos hramos closed this as completed Mar 10, 2017
@adbl
Copy link
Contributor

adbl commented Mar 11, 2017

@hramos it is still an issue, it acts differently in iOS 10 vs before. There are hacks to get around it, the best one I could come up with is to add zero width space to the text. It's still a bug

@hramos
Copy link
Contributor

hramos commented Mar 14, 2017

Alright - can you open a new issue?

@adbl
Copy link
Contributor

adbl commented Mar 14, 2017 via email

@hramos
Copy link
Contributor

hramos commented Mar 14, 2017

The issue lacks all the detail required in the template, has been open for a really long time, and people have commented with possibly unrelated issues. If someone really cares about this, then the best way forward is to open a new issue with all the necessary details.

@adbl
Copy link
Contributor

adbl commented Mar 14, 2017 via email

@rikur
Copy link

rikur commented Mar 21, 2018

Still an issue.

@hramos
Copy link
Contributor

hramos commented Mar 21, 2018

Please open a new issue.

@rikur
Copy link

rikur commented Mar 23, 2018

@hramos I would love to, but unfortunately I can't verify the issue with latest version of React Native as it breaks remote debugging. I noticed the latest version has new implementation of Text.

I will try again with the next release.

@ccfz
Copy link

ccfz commented May 31, 2018

Since this issue is closed I moved my workaround solution to: #18559

@facebook facebook locked as resolved and limited conversation to collaborators May 31, 2018
@react-native-bot react-native-bot added the Resolution: Locked This issue was locked by the bot. label Jul 20, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Resolution: Locked This issue was locked by the bot.
Projects
None yet
Development

No branches or pull requests

10 participants