Fix issue with scroll position after loading data in Chrome 56+

Image for post
Image for post

Chrome 56 executes some computations to make the scroll position stay in the same position. This currently looks like this:

Image for post
Image for post
Current behavior in Chrome 56+
Image for post
Image for post
Expected behavior

How to change this behavior?

overflow-anchor to the rescue! https://developer.mozilla.org/en-US/docs/Web/CSS/overflow-anchor

overflow-anchor: none;

It’s as easy as this. The result now looks again like this:

Image for post
Image for post
with overflow-anchor set to none

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store