react-native icon indicating copy to clipboard operation
react-native copied to clipboard

[Text] Emoji changes the line height

Open h3l opened this issue 11 years ago • 22 comments

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

h3l avatar Dec 01 '15 04:12 h3l

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!

facebook-github-bot avatar Dec 01 '15 04:12 facebook-github-bot

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 avatar Mar 13 '16 21:03 adbl

@h3l do you know of any workaround?

adbl avatar Mar 13 '16 21:03 adbl

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

h3l avatar Mar 14 '16 02:03 h3l

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?)...

adbl avatar Mar 14 '16 14:03 adbl

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

h3l avatar Mar 15 '16 07:03 h3l

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

h3l avatar Mar 15 '16 07:03 h3l

@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..

brentvatne avatar May 13 '16 03:05 brentvatne

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

eugenehp avatar Jun 26 '16 00:06 eugenehp

@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?

eugenehp avatar Jun 26 '16 01:06 eugenehp

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.

adbl avatar Oct 18 '16 21:10 adbl

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

regrex avatar Nov 03 '16 11:11 regrex

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 avatar Mar 10 '17 20:03 hramos

@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

adbl avatar Mar 11 '17 11:03 adbl

Alright - can you open a new issue?

hramos avatar Mar 14 '17 18:03 hramos

I will not bother because we have solved it for our purposes. This issue has some of the information that explains what is wrong. Why close and open a new one? On Tue, 14 Mar 2017 at 19:30, Héctor Ramos [email protected] wrote:

Alright - can you open a new issue?

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/facebook/react-native/issues/4457#issuecomment-286516767, or mute the thread https://github.com/notifications/unsubscribe-auth/AAK22LSAIJiRdWiQmw0VPXzSE_FlGnYLks5rltzHgaJpZM4Gr_yj .

adbl avatar Mar 14 '17 18:03 adbl

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.

hramos avatar Mar 14 '17 19:03 hramos

Ok, hopefully someone does care about it enough to do that then. On Tue, 14 Mar 2017 at 20:05, Héctor Ramos [email protected] wrote:

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.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/facebook/react-native/issues/4457#issuecomment-286527370, or mute the thread https://github.com/notifications/unsubscribe-auth/AAK22Nuh421GH8iwIS4P9lAiuOnGCnAUks5rluT7gaJpZM4Gr_yj .

adbl avatar Mar 14 '17 19:03 adbl

Still an issue.

rikur avatar Mar 21 '18 07:03 rikur

Please open a new issue.

hramos avatar Mar 21 '18 17:03 hramos