Jump to content

Julia Shikanova

v3.10 ScrollTrigger.normalizeScroll breaks disabling scroll libs

Go to solution Solved by Cassie,

Recommended Posts


New v3.10 realise brought quite a few interesting new features and it's very exiting. But i'm experiencing slight issue with ScrollTrigger.normalizeScroll(true), body-scroll-lock, scroll-lock and possible other packages or solutions to disable page scrolling is breaking if it used with normalizeScroll (visible scroll bar disappears as expected, but page underneath is still scrollable).

See the Pen zYpyxJL by jshikanova (@jshikanova) on CodePen

Link to comment
Share on other sites

  • Solution

Hey Julia,


Glad you're enjoying the new features!

So, normalizeScroll() intercepts the browser's native scrolling behavior. I wouldn't be surprised if other third party libraries break as the scroll is happening on the Javascript thread instead.

We've made it 'opt-in' because for the majority of cases it isn't needed and ideally the browser should be handling scroll. It can be helpful to get around some issues on IOS safari, but I would recommend only using it if necessary and not as a default.

As an option here, you could kill normalizeScroll() when the modal is open?

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

  • Like 4
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.