Jump to content
Search Community

ScrollTrigger manual refresh with ScrollSmoother causes unwanted jumps

BenjaminO test
Moderator Tag

Recommended Posts

Hello @GreenSock,

 

I remarked that manually refreshing ScrollTrigger with a ScrollSmoother instance could cause unwanted jumps. In the demo, when adding a div to the DOM, the viewport jumps to top then scrolling back to current position 😅. 

 

Is there a practical way to fix this issue ? Many thanks in advance for your help.

 

PS: I made a small video about it here also = https://mega.nz/folder/3g4TASYD#z0sdpbAvSK2sWbUYQsYIgQ

 

See the Pen MWGrxze by benjamOD2 (@benjamOD2) on CodePen

Link to comment
Share on other sites

Hey there, thanks for flagging - what browser are you using? I'm not getting the same behaviour in chrome/mac

FYI - I've removed the first scrollTrigger refresh - (not sure what the purpose of that one was). I also renamed your start var to 'test' because that confused me a little!


See the Pen ZEjQVjR?editors=0010 by GreenSock (@GreenSock) on CodePen


   

 

 

 

  • Thanks 1
Link to comment
Share on other sites

I tested on Chrome / Safari and Firefox with a Mac (MacOS Ventura). The problem is that ScrollTrigger is not refreshed when adding element to the DOM or when a div is resized, especially on Mobile (maybe because of the ScrollSmoother option ignoreMobileResize: true ?). That's the reason why I needed to refresh ScrollTrigger manually in my case.

 

The scroll from top to current position is only happening on desktop (not mobile).

 

Maybe there is another solution, I am open to suggestion. 

 

I made a new video of my case here : https://mega.nz/folder/3g4TASYD#z0sdpbAvSK2sWbUYQsYIgQ

Link to comment
Share on other sites

Hm, I cannot replicate on any browser. I tried Chrome, Safari, and Firefox on MacOS Ventura and all performed just fine. Is there a secret to replicating? I wonder if you've got an old version cached? Would you mind clearing your cache please and letting us know what steps to take to reproduce the problem? 

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...