Skip to content
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

fix: touch event canceled with gesture disabled #1032

Merged
merged 4 commits into from
Aug 3, 2021

Conversation

Ubax
Copy link
Contributor

@Ubax Ubax commented Aug 2, 2021

Description

Fixes #1022

Changes

Adds event cancelation only when gesture should be recognized.

Test code and steps to reproduce

Test1032.tsx

Checklist

  • Included code example that can be used to test this change
  • Ensured that CI passes

Copy link
Member

@WoLewicki WoLewicki left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good! I left some comments, please answer them and I think we can merge it then.

TestsExample/src/Test1032.tsx Outdated Show resolved Hide resolved
TestsExample/src/Test1032.tsx Outdated Show resolved Hide resolved
</NavigationContainer >
<View>
<Text>Gesture enabled</Text>
<Switch value={gestureEnabled} onValueChange={setGestureEnable} />
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You can switch gestureEnabled directly in Second by adding such switch there and using navigation.setOptions.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think that being able to change it on both screens is useful, so I would keep it outside

ios/RNSScreenStack.m Outdated Show resolved Hide resolved
ios/RNSScreenStack.m Outdated Show resolved Hide resolved
Copy link
Member

@kacperkapusciak kacperkapusciak left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM 👏

@Ubax Ubax merged commit faaeb69 into master Aug 3, 2021
@Ubax Ubax deleted the @ubax/fix-native-stack-touch-events branch August 3, 2021 09:18
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

Successfully merging this pull request may close these issues.

RN Touch events are canceled even when {gestureEnabled: false} on iOS when using native stack navigation
3 participants