FormidableLabs / FormidableLabs/react-swipeable

Prevent swipe action when intended action is scroll

Open
#194 9 comments 2 reactions 0 assignees View on GitHub
Dominant language
TypeScript
Stars
2.1k
Forks
149
PR merge metrics
No merged PRs in 30d

Description

I have a container that is vertically scrollable and also includes a `onSwipedUp` action. When the container is vertically scrolled, the action gets called but that is not the intention at that point. I know it is possible to track the scrolling and prevent the swipe up action until the container is at scroll end, but is there a prop to achieve this internally?

```
const handlers = useSwipeable({ onSwipedUp: () => { /* action gets called on scroll as well */ } })

// container is scrollable but onSwipedUp gets called as well```

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.