Amphtml: `amp-fit-text` doesn't consistently ellipsize depending on its initial width

Created on 20 Nov 2020  路  3Comments  路  Source: ampproject/amphtml

What's the issue?

Under certain circumstances, amp-fit-text doesn't consistently ellipsize its contents depending on its initial width.

How do we reproduce the issue?

Visit this AMP playground link and notice that amp-fit-text ellipsizes correctly for the entire session if its initial width should result in ellipsizing, but that it does not correctly ellipsize otherwise. See the video in this ZIP file of the issue (GitHub didn't let me upload the unzipped video file).

Note that the playground code is a real-world use case. The purpose of the code in the playground is to ellipsize after a certain number of lines (2 in this case), but prevent the text from taking up the height of two lines when the height of one line is sufficient to contain the text (this is done by having an additional div, with visibility: hidden; and containing the same text, determine the height of the outer div).

What browsers are affected?

I noticed this issue in Chrome, Firefox, and Safari (these are the browsers I have installed on my Mac). I suspect it occurs in every browser.

Which AMP version is affected?

The version printed in the console was 2011070101001. I don't know how long this bug has been around.

amp-fit-text Soon Bug components

All 3 comments

@TomerAberbach Thanks for filing this issue! I can reproduce in the email and web formats.

Please note also: This issue cannot be reproduced in amp-fit-text:1.0 (in development).

@rebeccanthomas Is this related to your fit-textissue?

Neither @TomerAberbach nor I can reproduce the original issue anymore. It looks to be fixed in or before 2012301722001, which oddly enough does not appear to contain #31317. Closing the issue.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

mrjoro picture mrjoro  路  3Comments

gmajoulet picture gmajoulet  路  3Comments

westonruter picture westonruter  路  3Comments

choumx picture choumx  路  3Comments

akshaylive picture akshaylive  路  3Comments