Skip to content

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

Closed
@wvq

Description

@wvq

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions