magic-akari / seamless-scroll-polyfill

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

Behaviour smooth not working #129

Closed glassesUSA closed 2 years ago

glassesUSA commented 3 years ago

When using behaviour smooth it doesnt scroll smoothly on the latest version.


        i.src = "https://cdn.jsdelivr.net/npm/seamless-scroll-polyfill@latest/lib/bundle.min.js"
        document.head.append(i)

        document.querySelector('a[href="#get-started"]').addEventListener("click", e => {
            e.preventDefault()

            seamless.elementScrollIntoView(document.querySelector('#get-started'), {
                behaviour: "smooth",
            })
        })
magic-akari commented 3 years ago

Hi, thanks for the feedback.

Please try to change the field name

             seamless.elementScrollIntoView(document.querySelector('#get-started'), {
-                behaviour: "smooth",
+                behavior: "smooth",
             })