Skip to content

when scrollEnabled={false}, should panGesture also disabled? #982

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wvq opened this issue Mar 24, 2025 · 2 comments
Closed

when scrollEnabled={false}, should panGesture also disabled? #982

wvq opened this issue Mar 24, 2025 · 2 comments

Comments

@wvq
Copy link

wvq commented Mar 24, 2025

Environment

"react-native-pager-view": "6.7.0",
"react-native": "0.77.1"

Description

On iOS, scrollEnabled={false},navigator's back gestuer is broken
Why need pan gestuer in this case?

I use a temporary solution by adding code in ./node_modules/react-native-pager-view/ios/Fabric/RNCPagerViewComponentView.mm to fix it:

- (BOOL)gestureRecognizerShouldBegin:(UIGestureRecognizer *)gestureRecognizer {
  const auto &viewProps = *std::static_pointer_cast<const RNCViewPagerProps>(_props);
  return viewProps.scrollEnabled;
}

It works for me.
I want to make a PR, but I don't know if there is other logic that requires panGesture when scrollEnabled=false

@MrRefactor
Copy link
Collaborator

Hey, please create a PR and test it with examples

@MrRefactor
Copy link
Collaborator

Closing as we merged #936

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants