expo icon indicating copy to clipboard operation
expo copied to clipboard

[Expo-Router] Header Pressable Components Not Responding Correctly to Touch Events

Open MrPancakes39 opened this issue 1 year ago • 5 comments

Minimal reproducible example

https://github.com/MrPancakes39/expo-router-onPress-navigation-bug

Which package manager are you using? (Yarn is recommended)

npm

If the issue is web-related, please select the bundler (web.bundler in the app.json)

None

Summary

Having Pressable, TouchableOpacity, or PlatformPressable in the header of a screen will make it not fire onPress event handler. Furthermore, putting a finger down will automatically fire onPressIn then onPressOut handlers even if the finger didn't lift up from the Pressable Component.

Environment

expo-env-info 1.2.2 environment info:
    System:
      OS: Linux 6.9 Pop!_OS 22.04 LTS
      Shell: 3.3.1 - /usr/bin/fish
    Binaries:
      Node: 22.11.0 - ~/.nvm/versions/node/v22.11.0/bin/node
      npm: 10.8.3 - ~/.nvm/versions/node/v22.11.0/bin/npm
      Watchman: 4.9.0 - /usr/bin/watchman
    IDEs:
      Android Studio: AI-241.18034.62.2411.12071903
    npmPackages:
      expo: ^52.0.30 => 52.0.30
      expo-router: ~4.0.6 => 4.0.17
      react: 18.3.1 => 18.3.1
      react-dom: 18.3.1 => 18.3.1
      react-native: 0.76.6 => 0.76.6
      react-native-web: ~0.19.10 => 0.19.13
    npmGlobalPackages:
      eas-cli: 13.4.2
    Expo Workflow: managed

MrPancakes39 avatar Feb 05 '25 07:02 MrPancakes39

Note: We've had this bug from when Expo 52 basically came out with React Native 0.76 and React Navigation v7

MrPancakes39 avatar Feb 05 '25 07:02 MrPancakes39

Related issues: #12418, #12274

MrPancakes39 avatar Feb 05 '25 09:02 MrPancakes39

Also related issue: https://github.com/react-navigation/react-navigation/issues/7052

pinguluk avatar Feb 06 '25 11:02 pinguluk

A workaround is to use onPressIn, which works for now in the meantime.

https://github.com/react-navigation/react-navigation/issues/7052#issuecomment-2558390675

raky291 avatar Mar 15 '25 03:03 raky291

This issue is stale because it has been open for 90 days with no activity. If there is no activity in the next 7 days, the issue will be closed.

github-actions[bot] avatar Jun 13 '25 04:06 github-actions[bot]

This issue was closed because it has been inactive for 7 days since being marked as stale. Please open a new issue if you believe you are encountering a related problem.

github-actions[bot] avatar Jun 20 '25 05:06 github-actions[bot]