-
-
Notifications
You must be signed in to change notification settings - Fork 5k
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
Prevent swiping and clicking at the same time in Tabs #11313
Comments
Hey @Eloy8! Thanks for opening the issue. It seems that the issue doesn't contain a link to a repro. The best way to get attention to your issue is to provide an easy way for a developer to reproduce the issue. You can provide a repro using any of the following:
A snack link is preferred since it's the easiest way to both create and share a repro. If it's not possible to create a repro using a snack, link to a GitHub repo under your username is a good alternative. Don't link to a branch or specific file etc. as it won't be detected. Try to keep the repro as small as possible by narrowing down the minimal amount of code needed to reproduce the issue. Don't link to your entire project or a project containing code unrelated to the issue. See "How to create a Minimal, Reproducible Example" for more information. You can edit your original issue to include a link to the repro, or leave it as a comment. The issue will be closed automatically after a while if you don't provide a repro. |
Couldn't find version numbers for the following packages in the issue:
Can you update the issue to include version numbers for those packages? The version numbers must match the format 1.2.3. The versions mentioned in the issue for the following packages differ from the latest versions on npm:
Can you verify that the issue still exists after upgrading to the latest versions of these packages? |
Upgrading to the specific package numbers doesn't solve the issue, there is no change in the previously described behavior. |
@Eloy8 are you using Pressable from React Native for clickable items? Did you try using RectButton? |
@intergalacticspacehighway Thanks for your reply! Indeed we use the RN Pressable, I haven't tried RectButton. I will provide an minimal repo later today! |
@intergalacticspacehighway Thanks for your patience, I just finished creating a minimal repo to demonstrate the problem. All relevant code is put in the App.js file. It exists out of an overview and a detail Stack Screen. https://github.com/Eloy8/react-navigation-swipe-click-issue/blob/main/App.js Feel free to ask if there're any further questions! :) |
@Dhananjay-JSR Is the "needs response" label still relevant? |
I had the same problem, but this solution helped |
@DominicWiedman Thanks for your reply and suggestion! I've implemented it with the Pressable component and changed the position treshhold to 5 instead of 2. |
Hello 👋, this issue has been open for more than a month without a repro or any activity. If the issue is still present in the latest version, please provide a repro or leave a comment within 7 days to keep it open, otherwise it will be closed automatically. If you found a solution or workaround for the issue, please comment here for others to find. If this issue is critical for you, please consider sending a pull request to fix it. |
Late to the party, just wanted to reply with my solution. |
Hey! This issue is closed and isn't watched by the core team. You are welcome to discuss the issue with others in this thread, but if you think this issue is still valid and needs to be tracked, please open a new issue with a repro. |
Current behavior
Currently it's not possible to distinguish between a click event and swipe event in a Tab screen.
As seen in the recording bellow, when one swipes to a different tab from a clickable component, it also triggers a click event besides the swipe:
This combination of events will trigger both the click event (aka a navigation from the FlatList to a child component) as a swipe to a different Tab. It also seems to glitch a bit, so immediately after opening the child component it will go back to the parent component.
At this moment I haven't found a way to disable the click action when swiping, a solution would be a great improvement.
Since the code stack is private, no code is supplied. When necessary, a code snippet can be produced.
Expected behavior
When an user swipes on a Tab screen, it won't be accompanied by click events.
Reproduction
Platform
Packages
Environment
The text was updated successfully, but these errors were encountered: