Gutenberg: Title of the post in Gutenberg is not displayed full text

Created on 3 Sep 2019  ·  11Comments  ·  Source: WordPress/gutenberg

Describe the bug
If the title of the post in Gutenberg is long and it has 2 lines, then only one line is displayed sometimes

To reproduce
Steps to reproduce the behavior:

  1. Create a new post and add a long title (so it will move to a new line)
  2. Save the post and press ctrl + f5 to do a hard refresh, (sometimes when you visit first time you do not need a hard refresh) to visit the post

Expected behavior
So see the full title not only half the title

Screenshots
Screenshot what I see ----------------------------->
what i see
Screenshot what I expected to see ----------------------------->
expected to see

Desktop (please complete the following information):

  • OS: Windows 7 64 bit
  • Browser Chrome
  • Version 76.0.3809.132 (Official Build) (64-bit) - latest

Additional context

  • Gutenberg is a disaster, it's 2019 and so many bugs, I will try to report some more
General Interface [Type] Bug

Most helpful comment

@u1qqlv Thanks for creating this issue. I haven't been able to reproduce it despite a number of attempts, but I'll keep it open just to see if there are any more reports.

Please could you avoid posting additional commentary like "Gutenberg is a disaster". Those kind of comments belong in a blog post. This is an open-source project and it's important that every contributor is made to feel welcome.

All 11 comments

Gutenberg version is 6.4.0 and so many bugs, it should be BETA 0.6.4.0

@u1qqlv Thanks for creating this issue. I haven't been able to reproduce it despite a number of attempts, but I'll keep it open just to see if there are any more reports.

Please could you avoid posting additional commentary like "Gutenberg is a disaster". Those kind of comments belong in a blog post. This is an open-source project and it's important that every contributor is made to feel welcome.

I've been seeing this mistake for a long time. It can be reproduced. This does not always happen, so I can assume that it is related to incorrect calculation of the height element in post-title component.

Запись экрана 2019-09-03 в 14 53 26

Оn the example above, on the third attempt, he showed everything normal. Try the long headings of 4-5 lines.

Some updates:

I'm using clear Wordpress 5.2.2

I think the bug due to this component:

https://github.com/WordPress/gutenberg/blob/e0d2f4e4ebf52af425dd4147f6fa66865b86c858/packages/editor/src/components/post-title/index.js#L4

Apparently he doesn't always have time to calculate the altitude correctly.

Thanks for the extra details. I wasn't able to reproduce it with twentynineteen as the theme. I switched to the Gutenberg Starter Theme (https://github.com/WordPress/gutenberg-starter-theme) and it was easy to reproduce with that.

You're welcome! I will try to find more possible reasons - maybe it's because of the delay in drawing fonts? twentynineteen uses system fonts (minimum delays load), but Gutenberg starter theme and mine - Noto from Google Fonts.

Some updates:

@talldan try installing a Twenty Seventeen theme, which also uses fonts from Google Fonts and reproduce a bug. I did it. But with four attempts.

Запись экрана 2019-09-04 в 12 22 13

Perhaps this is how it works - when page initialize, React Autosize Textarea calculates the height of the block based on the standard system font, then the font is loaded - but since it has different line spacing, letter height and other subtleties - we have this problem. Is there anything we can do about it? In React Autosize Textarea has an async option, but I'm not sure it'll help.

Yep, I think you're right, it probably is the async loading of fonts that causes it. When the bug occurs if I then set font-family: auto; in the dev tools the text fits perfectly.

I just saw it happen w/ the o2 Breathe theme, which also uses Noto Serif. Setting font-family:auto fixed it there too.

so is there a patch? / was this fixed?

If yes then we can close this...

@iandunn and @talldan is this a theme issue or is this something we can get fixed directly in Gutenberg?
I have myself come across the same problem a few times with different themes.

It seems like a bug in Gutenberg to me, and the intersection w/ fonts is just a symptom of the underlying problem.

Unless truncating the title is an intentional design decision, then I think it should be displayed in full, regardless of any CSS the theme sets.

Yes, I do I agree with you Ian!

I believe @ellatrix Ella has been working on something similar to this before.
Perhaps she is available to take a closer look at this problem.

Was this page helpful?
0 / 5 - 0 ratings