Skip to content
This repository has been archived by the owner on Nov 16, 2023. It is now read-only.

Text truncation doesn't behave consistently across browsers #261

Open
richardtagger opened this issue Feb 28, 2018 · 0 comments
Open

Text truncation doesn't behave consistently across browsers #261

richardtagger opened this issue Feb 28, 2018 · 0 comments
Labels

Comments

@richardtagger
Copy link
Contributor

richardtagger commented Feb 28, 2018

Issue is how IE/EDGE handles truncation of inline-block items - it seems to treat them as a single character, so truncates the entire inline-block down to an ellipsis. If display: inline is used here, all's well. Firefox does similar - seems that Chrome is the outlier here.

More context:-

  1. we use display: inline-block on because the browser will ignore line-height on inline elements if the nearest block-level ancestor has a larger line-height.
  2. we also need display: inline-block on when we ellipse text with "maxWidth", it doesn't work on an inline element.
  3. additionally, we use vertical-align: baseline to line up the baseline of text characters regardless of font-size, line-height, etc. BUT the browser says "nope" and forces vertical-align: bottom when overflow:hidden is added for maxWidth-ellipsed text. this throws off our vertical rhythm between different text on the same line, so we have rem vertical-align adjustments for these cases.
  4. but i've found that these are not reliable across browsers, Safari will adjust adjacent text higher or lower so i'm sure IE/Edge also has some wonkiness.

long story short, we might want to rethink , possibly doing the following:

  1. set to display: inline
  2. remove the maxWidth option from , find a different way to ellipse complicated groups of inline text (like in our message byline)
  3. just have to know that sized will match the vertical-align of its closest ancestor with a specified "textSize".
richardtagger added a commit that referenced this issue Feb 28, 2018
Works around an issue with ellipses truncation in browsers other than Chrome. See Issue #261
richardtagger added a commit that referenced this issue Feb 28, 2018
Works around an issue with ellipses truncation in browsers other than Chrome. See Issue #261
richardtagger added a commit that referenced this issue Mar 1, 2018
Works around an issue with ellipses truncation in browsers other than Chrome. See Issue #261
richardtagger added a commit that referenced this issue Mar 1, 2018
Works around an issue with ellipses truncation in browsers other than Chrome. See Issue #261
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

1 participant