Hello,
In a project im working on which is using gsap 3.11.5, updating to 3.12 or 3.12.1 breaks pinning. This behaviour is similar to what happens when you dont use a context. Im in SvelteKit and the break happens when changing pages. Essentially the dom isn't cleared up properly. Here's the code:
let trigger
onMount(() => {
const ctx = gsap.context(() => {
let tl = gsap.timeline({
ease: 'none',
scrollTrigger: {
trigger,
scrub: true,
start: 'top 25%',
end: '+=100%',
pin: true
}
})
tl.from('.body', {
y: 50,
autoAlpha: 0.25,
duration: 2
})
tl.fromTo(
'.body',
{ backgroundPosition: '50% 0%' },
{ y: -50, backgroundPosition: '50% 100%', duration: 4 }
)
tl.to('.body', {
y: -100,
autoAlpha: 0.25,
duration: 2
})
}, trigger)
return () => ctx.revert()
})
Is there something i need to do or is there a bug?