You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Just as a heads-up if you’re using the current master – or the jbks-shared branch…
There’s quite a significant amount of issues with the scroll view, that took an awful amount of time to debug because it’s not obvious – and there’s an off-by-one error courtesy of Safari iOS on top of that.
So the list of issues:
chapters’ navigation bar (previous/next) not displayed when you reach the bottom of the current chapter;
double-scroll happening in Chrome/Firefox i.e. you scroll and there’s an almost unnoticeable pause in your scrolling → that’s the iframe kinda behaving as a parasite, because its explicit height is not what those browsers expect;
in addition, progression is not updated correctly in those browsers;
finally onscroll event is not debounced (clear/setTimeout), so as resize, it will fire frantically – after debouncing it, I could see a significant performance boost in some browsers actually.
So to put it simply…
Don’t trust document.body when it comes to scroll. I learn the hard way scrolling is a clusterfuck, and document.body is supposed to be quirks mode.
In other words…
document.scrollingElement || document.body
is the way to go.
This scrollingElement will either be document.documentElement (compat mode) or document.body (quirks mode). And that pretty much solve all the issues, including in the iframe.
The text was updated successfully, but these errors were encountered:
Just as a heads-up if you’re using the current master – or the
jbks-shared
branch…There’s quite a significant amount of issues with the scroll view, that took an awful amount of time to debug because it’s not obvious – and there’s an off-by-one error courtesy of Safari iOS on top of that.
So the list of issues:
iframe
kinda behaving as a parasite, because its explicitheight
is not what those browsers expect;onscroll
event is not debounced (clear/setTimeout
), so asresize
, it will fire frantically – after debouncing it, I could see a significant performance boost in some browsers actually.So to put it simply…
Don’t trust
document.body
when it comes to scroll. I learn the hard way scrolling is a clusterfuck, anddocument.body
is supposed to be quirks mode.In other words…
is the way to go.
This
scrollingElement
will either bedocument.documentElement
(compat mode) ordocument.body
(quirks mode). And that pretty much solve all the issues, including in theiframe
.The text was updated successfully, but these errors were encountered: