Video with the issue
.timeline({
scrollTrigger: {
trigger: containerRef.current.querySelector(".containerDiv"),
start: "top top",
end: () => {
const containerDiv = document.querySelector(".containerDiv");
return containerDiv ? `+=${containerDiv.offsetWidth}` : 0;
},
pin: true,
scrub: true,
snap: {
inertia: false,
snapTo: "labelsDirectional",
duration: { min: 0.2, max: 1.6 },
ease: "power3",
delay: 0,
onStart() {
alert("snap started after a bit of scroll");
},
},
// onSnapComplete() {
// alert("snap completed");
// },
onUpdate: (trigger) => {
setProgressBar(trigger.progress);
},
},
})
I want you to focus on the snap property of scrollTrigger, the video shows how onStart() is only triggered after a bit of scroll has happened. I am unable to understand why this delay is occurring.
I'd create a minimal demo if this issue is not due to some common occurrence or my lack of understanding.