-
-
Notifications
You must be signed in to change notification settings - Fork 983
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
Make window.innerHeight available in getPageInfo() #685
Comments
Happy to take a PR if you want to add that.
|
Here's one: #686. Seems simple enough. I somehow couldn't get the tests to work though. If you could take a look? (Edit: seems to work on CI, but didn't locally...) Also, documentation is a bit misleading now. Thanks! |
Maybe the best solution is to also add Then the current options we can either explain in the docs what it actually does, or just leave it in undocumented for backwards compatibility. |
Ok, I've done that. I renamed them to Tests are now working. |
Use case
My iframe contains an Infinite loader (using 'react-visibility-sensor'), which loads list items whenever the user scrolls to the bottom of a list. The iframe adjusts its height according to the number of items already in the list. The iframe doesn't scroll at all, only the parent document does.
Problem
I can't determine the parent's viewport from within the iframe. Using
getPageInfo()
I can get close, but unfortunately,clientHeight
doesn't work, because it's the document's size and the document will be taller than the actual viewport and parts of it may be off-screen. I only want to trigger reload when bottom of the list is visible in the window.Proposed Solution
Make
window.innerHeight
andwindow.innerWidth
available ingetPageInfo()
.The text was updated successfully, but these errors were encountered: