Use document.documentElement.clientHeight instead of window.innerHeight #22
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Hello Mikhail,
I like your library and am using it on my projects. However, recently I encountered this WebKit issue (WebKit runs PWAs on iOS): https://bugs.webkit.org/show_bug.cgi?id=170595
TL;DR version of the issue is that one cannot rely on
window.innerHeight
after rotating the phone back and forth (several times), as it has useless / bogus values. In the thread they recommend usingdocument.documentElement.clientHeight
instead.I updated the
getWindowHeight.js
file like that (still havingwindow.innerHeight
as a fallback) and tested it on desktop, mobile Safari on iOS, and with my testing PWA in WebKit on iOS as well. Works nicely everywhere.In this PR there are two commits, first one with the one-line change as described above, in the second commit I updated some dependencies and CHANGELOG.mg and bumped the version in case you decide to merge the PR.
PS: I checked the reported issues here as well, and believe it is the same problem, so perhaps this change might address them as well...
In case you'd like me to update this PR in any way, please let me know.
Cheers,
-Roman