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

wrong width of span on load

Open yesh opened this issue 2 years ago • 2 comments

Hi, I don't know if I am implementing the component in a wrong way or if it is a bug.

I'm trying to truncate plain text in a gatsby project:

the code is

<div>
  <Truncate lines={3}>
    {text}
  </Truncate>
</div>

where the input text is:

Retro vegan hammock, street art listicle pop-up tilde organic trust fund authentic. Affogato af franzen aesthetic selvage cred. Hashtag la croix vape heirloom umami kinfolk. Before they sold out lyft crucifix venmo. Flannel tacos beard selfies master cleanse, +1 plaid gastropub. Fashion axe mumblecore ennui four loko, snackwave kitsch hell of leggings. Actually thundercats blog +1 echo park dreamcatcher occupy slow-carb 3 wolf moon hell of seitan subway tile sustainable flannel coloring book.

and on page load the result looks like this:

Screenshot 2021-07-23 at 12 24 06

then if I resize the browser window the text resizes correctly like this:

Screenshot 2021-07-23 at 12 24 13

am I missing something in the settings or is it a bug?

thank you.

yesh avatar Jul 24 '21 11:07 yesh

@yesh were you able to fix this?

pguduguntla avatar Jul 06 '23 20:07 pguduguntla

@yesh were you able to fix this?

unfortunately not.

yesh avatar Aug 21 '23 11:08 yesh