Sikander Posted August 21, 2022 Share Posted August 21, 2022 Hi whenever i scroll to the bottom of the page and start to scroll up it automatically jumps to the start of the second pinned element. This happens just on mobile phones while on desktops or laptops it works perfectly fine Here is a video of it happening: https://drive.google.com/file/d/1Nk-I3ZE0ANR5gr7lavz3XOBwLh_hVfao/view?usp=sharing Sandbox link: https://codesandbox.io/s/flamboyant-rgb-th6jx8?file=/src/App.js:248-267 Link to comment Share on other sites More sharing options...
GSAP Helper Posted August 22, 2022 Share Posted August 22, 2022 We love helping with GSAP-related questions, but unfortunately we just don't have the resources to provide free general troubleshooting of large chunks of code. Of course anyone else is welcome to post an answer if they'd like - we just want to manage expectations. I don't see anything obvious that'd make it scroll - it doesn't look like you're using an "snap" value. So I suspect the issue is unrelated to GSAP/ScrollTrigger. Otherwise, if you've got a GSAP-specific question just post that here along with a minimal demo and we'd be happy to take a look. Link to comment Share on other sites More sharing options...
Sikander Posted August 22, 2022 Author Share Posted August 22, 2022 I tried making a minimal demo but in the minimal demo the bug is not there. Here is the live website: Wagmi Labz (yuga-website.vercel.app) the bug happens just on mobile. Link to comment Share on other sites More sharing options...
Sikander Posted August 22, 2022 Author Share Posted August 22, 2022 So i removed the pinned sections and now it works perfectly fine but when ever i add the pinned sections the bug happens, which is when i scroll up on phone it jumps automatically to the top of the nearest pinned section Link to comment Share on other sites More sharing options...
Solution Sikander Posted August 22, 2022 Author Solution Share Posted August 22, 2022 So i fixed it after alot of research and going through forum threads Problem was that i needed this line of code when i was on mobile screen ScrollTrigger.normalizeScroll(true); 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