Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Doesn't work with even line number #90

Open
brindalakhani opened this issue Sep 30, 2021 · 1 comment
Open

Doesn't work with even line number #90

brindalakhani opened this issue Sep 30, 2021 · 1 comment

Comments

@brindalakhani
Copy link

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!

@xiaody
Copy link
Owner

xiaody commented Dec 17, 2021

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants