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

When using TouchableWithoutFeedback as trigger onPressIn/Out has a weird behavior #123

Open
JustJoostNL opened this issue Jan 1, 2025 · 0 comments

Comments

@JustJoostNL
Copy link

JustJoostNL commented Jan 1, 2025

Description

Hey!

When using TouchableWithoutFeedback (or just any Touchable component from react-native) there is a weird behavior.

Reproduction

Use TouchableWithoutFeedbackas trigger, and define onPressIn and onPressOut like this:

<TouchableWithoutFeedback
  onPressIn={() => {
    console.log("in");
  }}
  onPressOut={() => {
    console.log("out");
  }}
  style={{...}}
>
  ...
</TouchableWithoutFeedback>

Observation / Issue

  • When you press and hold the Touchable it correctly prints in,
  • When you release it again it correctly prints out.

By this point the menu is open.

  • Now, (while the menu is open) press and hold the Touchable, it logs in and instantly after it logs out.

This means it is logging out before we've released the Touchable, which obviously isn't correct. This seems like a small issue, but this makes it impossible to correctly animate the touchable based on press in/out events.

This occurs on the latest version (3.0.0-23)

Would love some help. Thanks in advance!

Also: just want to thank you for this library, its awesome!

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

1 participant