Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
Panel with content taller than page causes scroll position to jump up when resizing screen or scrolling on mobile. #7572
The scroll position jumps up (probably to the top).
This is particularly bad on mobile (tested on android chrome) because scrolling up and down shows and hides the address bar which triggers resize events and makes scroll position jump.
I initially though this had the same root cause as issue
Additional debuging information:
I had to set a watch on document.body.scrollTop to see it change while stepping through page.css('min-height'... as the scroll position only becomes visible later in chrome after the resize event callbacks are finished executing. My guess of what is happening is that when min-height is modified there is a glitch between the old and new values where the scroll bar position is calculated as if no min-height was set, based on the page height without taking into account the panel height because it is position:absolute. Not sure what is the best way to solve this.