Mkdocs-material: Sidebars scroll is finished already on page load.

Created on 3 May 2020  路  5Comments  路  Source: squidfunk/mkdocs-material

Hi,

When loading the document page if left and right sidebars are scrollable then they are already scrolled that鈥檚 not good.

Any fix to start scroll from start on page load?

Issue also appears on the actual document of Material theme. Screenshot: https://jmp.sh/6yVoAGE

Thanks

bug

Most helpful comment

Released as part of 5.1.5.

All 5 comments

That's odd. It should start from the top.

Note, that this only seems to happen in Chrome. It seems that Firefox and Safari are unaffected.

Oddly enough, this seems to be a bug in Chrome 81+ which is related to scroll-snap-type. It worked before and I'm not seeing the behavior on any other browser.

If we set scroll-snap-type after a slight delay (as in 1b72c9f1), it seems to work fine, though. We can include and ship this hack until Chrome resolves the issue, as it's really annoying. If somebody comes up with a better explanation and/or hack, I'm happy to merge PRs.

Released as part of 5.1.5.

Thank you @squidfunk for this quick fix and release!

Was this page helpful?
0 / 5 - 0 ratings