callstack / callstack/react-native-pager-view

Any way to disable onPress on child views while swiping?

Open
#509 4 comments 0 reactions 0 assignees View on GitHub
question
Dominant language
TypeScript
Stars
3.4k
Forks
476
Avg merge
10d 21h
Merged PRs (30d)
2

Description

I have an issue where onPress gets triggered on child views while I'm swiping in the pager view. Is there some way to prevent this from happening?

I tried tracking the pager state with the events:

```
{
setPageScrolling(e.nativeEvent.pageScrollState != "idle");
console.log("page scrolling", e.nativeEvent.pageScrollState != "idle");
};
const onMoveShouldSetResponderCapture = (e) => {
return pageScrolling;
};
const onPageScroll = (e) => {
console.log("scrolling");
setPageScrolling(true);
};
```

I'm using version 5.4.9 and Expo Go.

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.