-
Notifications
You must be signed in to change notification settings - Fork 523
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
documentElement.clientHeight returns full content height #257
Comments
Applying I didn't test on |
@CruelMoney can you share a link to the site where you're seeing this? In my experience the vast majority of sites will report the |
@philipwalton My personal website. Haven't tried to set |
Thanks, you're definitely doing some unusual things with layout there :) but I guess it shows that |
@CruelMoney, you have no doctype declaration and so the "quirks mode". try to add:
|
Thank you @Yaffle This did the trick on a bug we were tracking down in an example application :) |
@Yaffle you are awesome! Didn't even think about this mistake! How can I donate you? |
I'm going to declare handling quirksmode to be out of scope. Doctypes are cool. :) Let's close here. |
hi , i faced the same problem just a few hours ago , and i notice when i put body{
position : absolute ;
height : 100% ;
} then clientHeight will works 🤔 |
When using the polyfill my entries always have an intersectionRatio of 1. I've just spend some time debugging it, and after some time I figured the problem is in the following part of
_getRootRect()
:It defaults to use document.documentElement.clientHeight which in my case returns the full height of all content, whereas document.body.clientHeight will return the height of the viewport (which I guess is the intention).
Switching to prefer body over documentElement, makes the polyfill work for me. Can anyone ellaborate on why to use documentElement?
The text was updated successfully, but these errors were encountered: