I got an Issue with the ScrollTrigger Method "onUpdate":
I am trying to "snap" the sections on a Scroll Update (I don't want to use snap: because the user has to stop scrolling to trigger the snap and it should happen onUpdate).
So If I am in section1 and trigger onUpdate and if direction === 1, then it should scrollIntoView to Section2:
ScrollTrigger interfering with scrollIntoView
in GSAP
Posted
I got an Issue with the ScrollTrigger Method "onUpdate":
I am trying to "snap" the sections on a Scroll Update (I don't want to use snap: because the user has to stop scrolling to trigger the snap and it should happen onUpdate).
So If I am in section1 and trigger onUpdate and if direction === 1, then it should scrollIntoView to Section2:
The problem I am having, is that the behavior: 'smooth', is interfiering with ScrollTrigger and it's not scrolling to the center.
I tried to change the direction (if direction === -1) and it is scrolling to the block, but wouldn't make sense to use.
My Question is, if there is an even simpler solution or if its a bug, how can I fix it?
Thanks in advance :D