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

getBoundingClientRect needs to be parsed #241

Open
Dahkon opened this issue Jul 4, 2019 · 1 comment
Open

getBoundingClientRect needs to be parsed #241

Dahkon opened this issue Jul 4, 2019 · 1 comment

Comments

@Dahkon
Copy link

Dahkon commented Jul 4, 2019

I came on a bug that only occurs en chrome desktop mode, brave is ok, emulation mobile is ok too...

Here is the line on the dist file that needs to be corrected :
481 var expanded = parseInt(element.getBoundingClientRect().height) <= element.readmore.collapsedHeight;

parseInt fix the issue. Else the value returned by this function is not equal or less to collapsedHeight (240.000001453 > 240).

Hope it helps.

@zakutnya
Copy link

Got the exact same issue in Chrome (98.0.4758.102), the block won't expand because of:

console.log(element.getBoundingClientRect().height, element.readmore.collapsedHeight)
// 200.00001525878906 200

Another suggestion is to take heightMargin option into account when defining var expanded on line 481:

var expanded = element.getBoundingClientRect().height <= element.readmore.collapsedHeight + element.readmore.heightMargin;

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

No branches or pull requests

2 participants