Skip to content

fix(deps): update dependency compute-scroll-into-view to v4 - #1142

Open
renovate[bot] wants to merge 1 commit into
mainfrom
renovate/major-4-scroll-into-view
Open

renovate[bot] wants to merge 1 commit into
mainfrom
renovate/major-4-scroll-into-view

Conversation

@renovate

@renovate renovate Bot commented Nov 23, 2026 •

Copy link
Copy Markdown
Contributor

This PR contains the following updates:

Package Change Age Confidence
compute-scroll-into-view (source) ^3.1.1 → ^4.0.0 age confidence

Release Notes

scroll-into-view/compute-scroll-into-view (compute-scroll-into-view)

v4.0.0

Compare Source

Major Changes
  • #​938 d026dba Thanks @​tembo! - Ship ESM only, with the package exports generated by tsdown.

    • The CommonJS build (dist/index.cjs) is removed. On Node.js 20.19+ and 22.12+, require('compute-scroll-into-view') still works through require(esm) and returns { compute }.
    • TypeScript projects with CommonJS files must use "module": "nodenext". With "module": "node16", TypeScript reports TS1479 when CommonJS files import an ES module. ESM files and "moduleResolution": "bundler" are unaffected.
    • exports is now { ".": "./dist/index.js" }. The source export condition and the source and typings fields are removed. types replaces typings.
  • #​953 88378bf Thanks @​stipsan! - compute(target, options) is spec-only. The scrollMode, boundary and skipOverflowHiddenElements options are removed, and are middleware instead, with the same behavior. The built-in middleware are exported from compute-scroll-into-view/middleware, so the main entry only has compute and its types. Middleware can also change how scroll containers are found and measured, like scroll-margin and scroll-padding. options is now optional.

    import { compute } from 'compute-scroll-into-view'
    import {
      boundary,
      onlyIfNeeded,
      skipOverflowHiddenElements,
    } from 'compute-scroll-into-view/middleware'
    
    // Before: compute(node, { scrollMode: 'if-needed', boundary: list, skipOverflowHiddenElements: true })
    compute(node, {
      middleware: [boundary(list), skipOverflowHiddenElements(), onlyIfNeeded()],
    })
    • Put onlyIfNeeded() after the other middleware, which is how the options combined.
    • The ScrollMode type is removed. ComputeOptions is an alias of Options, and the Middleware, MiddlewareState, MiddlewareReturn, Rects and SideObject types are exported from compute-scroll-into-view.
Minor Changes
  • #​952 3a93d4c Thanks @​stipsan! - Add the container option from the CSSOM View spec's ScrollIntoViewOptions. container: 'nearest' only scrolls the target's nearest scroll container, or the viewport if it has none. The default, 'all', scrolls every scroll container as before.

  • #​966 245679d Thanks @​stipsan! - Scroll the scroll containers and the viewport of the parent document too, when the target is in a same-origin iframe, as Element.scrollIntoView() and the CSSOM View spec do. They align the <iframe> where the scrolling inside the frame left the target, up to the top-level document. Cross-origin parents aren't reachable, and aren't scrolled. A position: fixed target in a frame doesn't move with the frame's viewport, so only the parent document is scrolled for it. This also covers scrolling a frame's target from inside the frame (#​694).

  • #​951 520fd20 Thanks @​stipsan! - Respect scroll-padding and align scroll-margin like browsers do.

    • scroll-padding on scroll containers, and on the root element for the viewport, is now part of the alignment (#​831). Padding in percentages is supported.
    • scroll-margin of the target now works with block: 'center' and 'nearest', and together with scroll-padding (#​933).
    • scrollMode: 'if-needed' only counts a target as visible when its scroll-margin box is within the scroll containers' scroll-padding (#​817). For example, a target behind a fixed header that is covered by scroll-padding-top is scrolled into view.
    • nearest is measured from the padding edge of scroll containers with borders, instead of the border edge.
  • #​964 ed654a2 Thanks @​stipsan! - Land on the target's own snap position in its nearest scroll container when that's a scroll snap container, as the CSSOM View spec requires. On each axis that the container's scroll-snap-type snaps, the target's scroll-snap-align replaces block or inline there. The outer scroll containers now align the target from where the browser actually snaps the inner one.

  • #​970 46be135 Thanks @​stipsan! - Add the selection() middleware, which scrolls a text selection into view instead of the target element, like editors keep the caret in view (#​902). It takes a Selection or a Range, and defaults to the document's selection. The focus end is aligned, where the caret is: a collapsed caret is measured as the character or node next to it, so empty lines work too. align: 'bounds' aligns the whole selection instead. compute still walks the target's ancestors, so pass an element inside the editor. onlyIfNeeded() checks the selection when it runs after selection().

  • #​950 28e19bc Thanks @​stipsan! - Follow the target's writing-mode and direction, like browsers do, and support negative scroll offsets.

    • block and inline now refer to the target's block and inline axes. For example, inline: 'start' aligns to the right edge of a right-to-left target, and block: 'start' aligns to the right edge of a vertical-rl target. Horizontal left-to-right targets work as before.
    • Scroll containers that overflow to the left or top, like right-to-left or vertical-rl ones, now get the negative left and top offsets browsers use for them, instead of being clamped to 0 (#​821).
    • Scrollbars on the left side of a scroll container are accounted for.
Patch Changes
  • #​960 a51675f Thanks @​stipsan! - Scroll the body when it's a scroll container. Its overflow only applies to the viewport when the root's overflow is visible, so a body with overflow: auto under a root with overflow: hidden, auto or clip is scrolled now, like Element.scrollIntoView() does.

  • #​949 76f855d Thanks @​stipsan! - Declare the supported browsers as Baseline 2019 in the browserslist field of package.json, and build for it. The bundle now also compiles away optional catch binding for legacy Edge 18, and stays free of optional chaining and nullish coalescing. dist/index.d.ts.map is no longer published, as it pointed at src/, which isn't published either. dist/index.js.map still embeds the source.

  • #​957 e724874 Thanks @​feritcemkahraman! - Don't scroll overflow: visible elements inside an iframe. Only the iframe document's viewport (its root or scrolling element) is clipped by the iframe and scrolled when its content overflows it.

  • #​936 aaaccf9 Thanks @​tembo! - Check for HTMLElement and ShadowRoot properties with type guards instead of type assertions. The checks are the same, so behavior is unchanged. The type declarations now use the JSDoc @default tag instead of TSDoc's @defaultValue.

  • #​958 3b64201 Thanks @​satouriko! - Only scroll the scroll containers in the containing block chain of the target, like Element.scrollIntoView() does. Scroll containers that an absolutely or fixed positioned target escapes don't move it, so they aren't scrolled anymore, and the viewport isn't scrolled for a fixed positioned target either. Containing blocks follow position and the properties that contain positioned descendants, like transform, filter and contain. Middleware still visit those scroll containers, with scrollable: false.

  • #​961 4796634 Thanks @​stipsan! - Scroll the viewport when the target is the scrolling element, or the root element in quirks mode. They have no ancestor that scrolls the viewport, so compute(document.body) returned no actions in quirks mode, and compute(document.documentElement) didn't in standards mode.

  • #​956 9a21f0c Thanks @​Remiscan! - Scroll the scroll containers in a shadow tree that a slotted target is laid out in. The parent walk now goes from an element to its assignedSlot, before its parent element, so the slot's ancestors in the shadow tree are scrolled too, like Element.scrollIntoView() does.

  • #​971 f1fc35b Thanks @​stipsan! - Shrink the published bundle by about a fifth when minified. Measuring the four sides of a box and scrolling each axis now share one code path, and getPropertyValue() replaces the per-side style lookups. Behavior is unchanged.

  • #​962 e49fb1b Thanks @​stipsan! - Use the target's own document and window for viewport measurements, so scrolling a target inside a frame works when compute is called from the parent document.

v3.2.2

Compare Source

Patch Changes
  • #​942 9fe791e Thanks @​tembo! - Compile the published bundles to ES2019 syntax again. Releases 3.2.0 and 3.2.1 shipped optional chaining (?.) and nullish coalescing (??) because the browserslist targets drifted, which broke Webpack 4 and other older toolchains (scroll-into-view-if-needed#1235). The build targets are now pinned and the build fails if the output isn't ES2019-compatible.

v3.2.1

Compare Source

Patch Changes
  • #​940 1ba1f96 Thanks @​tembo! - Remove the engines.node requirement added in the previous release. Requiring Node.js 26 was unintentionally breaking for consumers on older Node.js versions, and as a browser library this package has no Node.js runtime requirement (compute-scroll-into-view#928)

v3.2.0

Compare Source

Minor Changes
  • #​923 c9096c4 Thanks @​stipsan! - Require Node.js 26 (current LTS) or later, and publish to npm with trusted publishing (OIDC) and provenance

Configuration

📅 Schedule: (UTC)

  • Branch creation
    • "before 3am on Monday"
  • Automerge
    • At any time (no schedule defined)

🚦 Automerge: Disabled by config. Please merge this manually once you are satisfied.

♻ Rebasing: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.

🔕 Ignore: Close this PR and you won't be reminded about this update again.


  • If you want to rebase/retry this PR, check this box

This PR has been generated by Mend Renovate using a curated preset maintained by Sanity. View repository job log here

@vercel

vercel Bot commented Nov 23, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
scroll-into-view-dev Ready Ready Preview Nov 23, 2026 2:21am UTC

Request Review

@socket-security

Copy link
Copy Markdown

Review the following changes in direct dependencies. Learn more about Socket for GitHub.

Diff Package Supply Chain
Security
Vulnerability Quality Maintenance License
Addedcompute-scroll-into-view@​4.0.010010010090100

View full report

This branch was successfully deployed

1 active deployment
Preview — 69bbfb96 Deployed Nov 23, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

0 participants