Open thisispete opened 2 weeks ago
oh.. ok something just noticed: it fires every time the contents changes - so I have a tweened element inside, it fires every frame until the animation ends, and then it stops firing.
ie:
const number = tweened(0, {
duration: 5000
});
const doOnce = () => {
console.log('once?');
$number = 15000
}
<IntersectionObserver once {element} on:intersect={doOnce}>
<div bind:this={element}>
{$number}
this also messes with the duration of the tween - as a side effect, it's resetting every frame, so it takes much longer the bigger the number or the more decimal places.
Could you provide a minimal repro? https://svelte.dev/playground/hello-world?version=5.2.0
Is this using Svelte 5? Happy to help debug.
when I use
once
andon:intersect
the function seems to be getting called every frame instead of just one time.