magic-akari / seamless-scroll-polyfill

Scroll Behavior polyfill
https://www.npmjs.com/package/seamless-scroll-polyfill
MIT License
159 stars 12 forks source link

block: "nearest" does not work if the element is the same height as the container #75

Closed jonom closed 5 years ago

jonom commented 5 years ago

If an element has the same height as the window (e.g. an element with height of 100vh) then

element.scrollIntoView({
    behavior: "smooth",
    block: "nearest"
});

has no effect.

jonom commented 5 years ago

Wow, that was a fast response! I was going to try to fix this today but you already did it 😄 thanks so much.

magic-akari commented 5 years ago

I forget to fix the same issue about inline "nearest". The current code is a bit confusing. May be fixed at the next refactoring.