⚓ Apply smooth scroll to anchor links, polyfill scroll-behavior
rollup
for more robust artifacts (decreases file sizes for .mjs
files but increases them for .js
files)package#packageManager
field to support corepacke
and t
)event.preventDefault()
on the click event (fix #32)/?page=1
to /?page=2#content
would not work: because the path is the same, the polyfill would intercept the navigation even though the different query params meant that the target was an entirely different page/website--scroll-behavior
define()
window.__forceSmoothscrollAnchorPolyfill__
polyfill({ force: true })
instead)index.mjs
and index.min.mjs
! 🚀<a href="#top">
doesn't smooth scroll now mentioned in docsscroll-behavior
and prefers-reduced-motion
anchor.pathname
with leading slash if it's missing in isAnchorToLocalElement()
, fixes flickering in IE9 (caused by clicks being handled by handleHashchange()
instead of handleClick()
due to click handler not detecting the clicked anchor)font-family
example in READMEdestroy()
and polyfill()
now return the polyfill instance so you can chain themdestroy()
, polyfill()
and { force }
override"unpkg"
in package.json
, points at minified version so CDN serves smaller filewindow.__forceSmoothscrollAnchorPolyfill__
with the { force: boolean }
argument of polyfill()
"main"
) now points to unminified file so typing hints are kept{ behavior: 'instant' }
(not in spec anymore) + outline alternative