Jump to content
Search Community

Scroll with trackpad and touchpad on overflow

Gregorek test
Moderator Tag

Go to solution Solved by GreenSock,

Recommended Posts

Hi,


I started using the plugin ScrollSmoother, and I have a problem. I can’t scroll with the trackpad and touchpad on overflow-x: scroll. On mobile, it works, and on non-touch devices, it doesn’t work. Do you know how to fix it or suggest how to do it differently?


Many thanks for considering my request.

See the Pen poKWJLr by Grzegorz-Perkowski (@Grzegorz-Perkowski) on CodePen

Link to comment
Share on other sites

  • Solution

Yeah, that's a tricky scenario with normalizeScroll. Try adding this: 

let stopPropagation = e => e.stopImmediatePropagation();
document.querySelectorAll("div").forEach(el => {
	if (el.scrollHeight > el.clientHeight) {
		el.addEventListener("wheel", stopPropagation);
		el.addEventListener("touchstart", stopPropagation);
	}
});

 

See the Pen oNyGzNZ?editors=1010 by GreenSock (@GreenSock) on CodePen

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...