react-lines-ellipsis icon indicating copy to clipboard operation
react-lines-ellipsis copied to clipboard

Doesn't work with even line number

Open brindalakhani opened this issue 4 years ago • 2 comments

Hello,

I've come across an interesting bug using this library.

Steps 1 : Add this code <HTMLEllipsis unsafeHTML='simple html content' maxLine="2" ellipsis="..." basedOn="letters" />

Step 2: Check in a web browser.

Chrome behavior : For the first time, It trims perfectly and display ... at line number 2. But When you reload the page It shows ... at line number 3.

Firefox and Safari behavior: It trims at line number 3 instead of line number 2.

Seems like, maxLine attribute doesn't work with even line number value(Ex: 2, 4, 6, 8 so on).

My browser details -

  1. Chrome : Version 94.0.4606.61 (Official Build) (x86_64)
  2. Safari : Version 14.0.3 (16610.4.3.1.4)
  3. Firefox : 92.0.1 (64-bit)

Please have a look into it .

Thank you!

brindalakhani avatar Sep 30 '21 07:09 brindalakhani

That sounds weird. Can you provide a online reproduction? https://stackblitz.com/edit/react-lines-ellipsis-2fjoj4 you can fork and edit this.

xiaody avatar Dec 17 '21 08:12 xiaody