MalinO Posted October 21, 2021 Share Posted October 21, 2021 I have a problem with ScrollTrigger, it stops working properly after I open up and close a modal on my single page application. I have build my application with React. The only thing I have found as a solution is to call the ScrollTrigger.refresh(). I have tried that but I can't get it to work. Can you give me some examples on how I should use it? The modal pops-up after I have clicked on a button. I don't think that I'm the first one who have had this problem. Really need your help! Best Regards, Malin Link to comment Share on other sites More sharing options...
OSUblake Posted October 21, 2021 Share Posted October 21, 2021 Welcome to the forums @MalinO It's impossible to say what's going on without seeing the issue. Can you make a minimal demo showing the issue? We don't need to see your entire project. Just enough code to recreate the issue. You can use CodeSandbox to make a React demo. Link to comment Share on other sites More sharing options...
Eric Llama Johnson Posted September 8, 2023 Share Posted September 8, 2023 (edited) I was running into this too and it turned out my issue was that I was calling `tl.scrollTrigger.enable(false);` before I restored the user's scroll position. I moved `tl.scrollTrigger.enable(false);` after the scroll position was restored and that solved it! Here's my Codepen demo: See the Pen a0a170062ea8f3395b40c5063bb59037?editors=1010 by ericdjohnson (@ericdjohnson) on CodePen Edited September 8, 2023 by Eric Llama Johnson Remove wrong screenshot 2 Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now