scroll-into-view / compute-scroll-into-view

Utility for calculating what should be scrolled, how it's scrolled is up to you
https://scroll-into-view.dev#scroll-alignment
MIT License
308 stars 27 forks source link

Zero-height scroll area results in NaN scrolling #900

Closed joshkel closed 1 year ago

joshkel commented 1 year ago

If compute-scroll-into-view tries to evaluate a scrollable container with zero height, it generates values of NaN.

See https://codesandbox.io/s/nifty-kate-gxf4k8?file=/src/index.js for an example.

A zero-height element can happen, for example, when using a grow transition. The growing element is initially rendered at 0 height, but I'd like to go ahead and scroll to it so that it will be visible as it grows.

github-actions[bot] commented 12 months ago

:tada: This issue has been resolved in version 3.1.0 :tada:

The release is available on:

Your semantic-release bot :package::rocket: