Skip to content

[useGesture] add option to disable horizontal or vertical gesture detection #35

@aamorozov

Description

@aamorozov

Description

Currently the hook tries to detect the gesture in both directions, which causes the issues with the carousels that need to be swiped only left to right/right to left.

Steps to Reproduce

Can be replicated here:
https://hz-core.netlify.com/use-page-gesture#example
Or here:
https://2u.netlify.com/components/carousel

Expected Result

orientation prop on the options object that is being passed to usePageGesture hook should prevent detection of the orientation that is not specified. I.e. if horizontal is specified only that direction should be detected.

Actual Result

It looks like usePageGesture hook already accepts an options object with orientation prop on it, but it doesn't seem to have any affect at the moment.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type: BugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions