Skip to content

How to fix horizontal scroll on trackpad? #446

@runnickrun

Description

@runnickrun

I have a website that has some sections with overflow-x:auto applied:
Codepen

When you try scrolling with a trackpad horizontally it still moves the page vertically a bit — as you can't do a perfect horizontal swipe on the trackpad. So minimal vertical scroll is still present and lenis reads it.

Is there a way to somehow detect scroll direction and prevent vertical scroll if it's horizontal?

Or would be the best solution? Disable lenis on those sections?

Thanks in advance!

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions