iamdustan / smoothscroll

Scroll Behavior polyfill
http://iamdustan.com/smoothscroll/
MIT License
3.85k stars 339 forks source link

Fix for #150: check for documentElement instead of body #151

Open dvdrhr opened 4 years ago

dvdrhr commented 4 years ago

https://github.com/iamdustan/smoothscroll/issues/150

works for me, tested in chrome, safari, edge, mobile chrome and mobile safari

jeremenichelli commented 4 years ago

Thanks for the PR first of all.

I think this one is missing a couple of edge cases for example when an element forces the window plus its scrollable container to scroll, d.body is referenced in other cases. I'd recommend running your local build in the repository page to test each case.

I will try to take a further look to try to detect edge cases. But the change is pointing into the right direct and it does solve your reported case in the issue 👍