solid-primitives icon indicating copy to clipboard operation
solid-primitives copied to clipboard

`spring` misses `{ hard: true }` (in Svelte 5 `{ instant: true }`)

Open newsve opened this issue 1 year ago • 2 comments

Describe the bug

filed as a bug not as a feature since the spring docs mention Svelte's spring as role model which has this

hard or instant true lets you interrupt the spring, feels like a random implementation detail but is essential for polished spring animations which are a bit more advanced

Minimal Reproduction Link

na

newsve avatar Dec 12 '24 11:12 newsve

The setter accepts options object setSpring(1000, {hard: true}) but it seems to be missing in the documentation take a look at the implementation for details

thetarnav avatar Dec 12 '24 11:12 thetarnav

Cool! Then, this should be seen as a doc issue or feel free to close it since we documented it trough this issue now.

Since they changed the key in Svelte 5 to instant which is a bit more intuitive, maybe it is a good idea to have an alias next to hard...

FWIW, I think Svelte's or this spring API is by far the best around not requiring a huge dep, actually the reason I use Svelte, so I was so happy to see to available for Solid. 🙂

newsve avatar Dec 12 '24 16:12 newsve