NewYour coding agent can read the release notes before it upgrades.Set up the MCP server →
npm · #3237 most downloaded on npm
Ponyfill for upcoming Element.scrollIntoView() APIs like scrollMode: if-needed, behavior: smooth and block: center
Last release 3 years ago
no release in 18 months
Release timing varies
gaps range from 3 weeks to 11 months
Nearly every release is documented
notes for 59 of the last 60 stable releases
1 version withdrawn
withdrawn after publishing
10 years old
83 releases · first in 2016
sideEffects: false in package.json to enable optimizations introduced in webpack v4.
sideEffects: false in package.json to enable optimizations introduced in webpack v4.Fixed: setup new release tag for test releases
One column per quarter.
New handleScroll option allows customizing scrolling behavior.
handleScroll option allows customizing scrolling behavior.Take control over how the target is scrolled into view. This function is called
for each parent node that need scrolling. scrollLeft and scrollTop are
destination coordinates. The from coordinates you'll have to get yourself if you
want to animate the transition using a different library.
When using this option you likely don't need the built in animation feature. To cut down on filesize you can do the following adjustment if you are using a recent version of webpack or rollbar (and use ES6 imports):
-import scrollIntoViewIfNeeded from 'scroll-into-view-if-needed'
+import maybeScrollIntoView from 'scroll-into-view-if-needed/dist/calculate'
-scrollIntoViewIfNeeded(node)
+maybeScrollIntoView(node, {handleScroll: (parent, {scrollLeft, scrollTop}, config) => {
+ // The following is actually the default implementation
+ // if this is all you need you can skip passing this option
+ parent.scrollLeft = scrollLeft
+ parent.scrollTop = scrollTop
+}})
Introducing a simpler two argument API. Check the updated README.md for instructions!
Introducing a simpler two argument API. Check the updated README.md for instructions!
Fixed: Missing TypeScript definitions and rollup/webpack pkg.module files from published package
Fixed: Package published on npm include unnecessary files bloating the package
Fixed: Don't use postinstall as it runs in userland
Fixed: Migrate tests to new page that showcases how it works
Fixed: TypeScript requires HTMLElement when it should accept Element
Fixed: Incorrect TypeScript declarations and export format
Fixed: Incorrect export declaration in TS typings
Fixed: Fifth option should be optional
New argument added that allows setting offsets in all 4 directions.
New argument added that allows setting offsets in all 4 directions.
Fixed: Windows compatibility and CommonJS interop change back to Babel 5 functionality (#121 @khell)
An optional argument finalElement was added to limit the scope of the function (#108 @hemnstill)
Reduced size of dist build by switching from rollup to babel (#106 @JKillian)
Updated typescript definition making options optional (#75 @pelotom)
Fix TypeScript definition file issues (#74 @forabi)
TypeScript definition file (#73 @forabi)
link to official ponyfill page (#68 @sindresorhus)
Incomatibility with default webpack config.
PULLED: accidentally pushed incomplete build to npm!
[unreleased]: https://github.com/scroll-into-view/scroll-into-view-if-needed/compare/v1.5.0...HEAD [1.5.0]: https://github.com/scroll-into-view/scroll
Your coding agent can read these notes before it upgrades. Set up the MCP server →