The Scroll Behavior specification has been introduced as an extension of the
Window interface to allow for the developer to opt in to native smooth scrolling. To date this has only been implemented in Firefox.
See it in action https://iamdustan.github.io/smoothscroll
Download the distribution file from this repository and include it in your project.
You can also find it in npm as smoothscroll-polyfill or bower as smoothscroll.
Requires requestAnimationFrame polyfill for browsers which don't support it!
If you prefer the polyfill to always override the current native methods (sometimes needed because of parcial implementations or inconsistencies between browsers), place this global variable before requiring the module or including the polyfill file.
window__forceSmoothScrollPolyfill__ = true;
Fork the repository and run npm install.
After any modification make sure it doesn't break in any of the supported browsers, check linting and build running npm run build and then open a pull request.
Successfully tested in:
If you have tested this and worked as expected in a different browser let us know so we can add it to the list, if not open an issue providing browser, browser version and a good description about it.