Open randypuro opened 4 years ago
Hey there. Thanks for reporting this issue. I'll need to investigate this because the polyfill does in fact default to {block: "start", inline: "nearest"}
for scrollIntoView
as seen here: https://github.com/wessberg/scroll-behavior-polyfill/blob/0e4973c514f0fc713dbe6a617273c2ce1db29e42/src/patch/element/scroll-into-view.ts#L14
Ahh, right. I think it's related only to to scrolling on anchor links then? They are partially determining the scrolling options from the scrolling container, and bypassing those defaults.
Then
is effectively defaulting to block: "center"
I believe
scrollIntoView
should default toblock: "start"
, but appears to be defaulting toblock: "center"
. This causes behavior differences from browsers with the built-in helpers; and also means smooth scrolled anchor links are not scrolling to the same position as non-smooth scrolled anchor links.