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

Round up document.documentElement.offsetHeight ?? #35

Open
golfecholima opened this issue Dec 8, 2023 · 1 comment
Open

Round up document.documentElement.offsetHeight ?? #35

golfecholima opened this issue Dec 8, 2023 · 1 comment

Comments

@golfecholima
Copy link

golfecholima commented Dec 8, 2023

In src/frames.js, I wonder if it would make sense to round up to the nearest whole pixel here:

function getDocumentHeight() {
	return document.documentElement.offsetHeight;
}

In LAT CMS at least it appears to be causing scroll bars (presumably because our CMS is rounding down??)

Surely there's some unintended consequence of doing this that I'm not thinking of ...

@rdmurphy
Copy link
Owner

There’s nothing to round in this case because offsetHeight is already a rounded integer.

Unless something has changed since I left I do remember that the CMS devs chose to not use my code for the parent/host side of frames and rewrote it, so my first guess would be to see if something has changed there.

Alternatively there may be something within the frame’s contents that is not being taken into account when offsetHeight is calculated. This shouldn’t be the problem but I would check and see if there is any unneeded margin/padding being added there at the very top or bottom of the embed.

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