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

Pressable interaction issue with StackNavigator on iPhone Xs + new architecture #43546

Closed
omniphx opened this issue Mar 19, 2024 · 3 comments
Closed
Labels
Resolution: Answered When the issue is resolved with a simple answer Type: New Architecture Issues and PRs related to new architecture (Fabric/Turbo Modules)

Comments

@omniphx
Copy link

omniphx commented Mar 19, 2024

Description

On iPhone Xs/Xs Max + the new architecture enabled, Pressable does not correctly respond to onPress when wrapped inside a StackNavigator. Seems to be an issue related to the Pressable rectangle not accounting for the space that the header takes up. If the component is not inside a StackNavigator screen, it will behave correctly.

Observed that touching the "pressable" area emits a LEAVE_RECT_AREA signal, but when I move my press to the top of the screen it will emit a ENTER_RECT_AREA signal and only fire the onPress if released there. Seems to think the pressable area is at the top of the screen possibly caused by the stack header (See video).

Steps to reproduce

  1. Clone this repo: https://github.com/omniphx/reproducer-navigation
  2. cd ReproducerApp
  3. yarn
  4. yarn install:pods
  5. yarn ios
  6. Press the "Press me" text. Console should output "pressed" if working as expected

React Native Version

0.73.6

Affected Platforms

Runtime - iOS

Areas

Fabric - The New Renderer

Output of npx react-native info

System:
  OS: macOS 14.4
  CPU: (10) arm64 Apple M2 Pro
  Memory: 134.39 MB / 32.00 GB
  Shell:
    version: "5.9"
    path: /bin/zsh
Binaries:
  Node:
    version: 20.11.0
    path: ~/.nvm/versions/node/v20.11.0/bin/node
  Yarn:
    version: 1.22.21
    path: ~/.nvm/versions/node/v20.11.0/bin/yarn
  npm:
    version: 10.2.4
    path: ~/.nvm/versions/node/v20.11.0/bin/npm
  Watchman:
    version: 2023.12.04.00
    path: /opt/homebrew/bin/watchman
Managers:
  CocoaPods:
    version: 1.14.3
    path: /Users/MITCHMX20/.rbenv/shims/pod
SDKs:
  iOS SDK:
    Platforms:
      - DriverKit 23.4
      - iOS 17.4
      - macOS 14.4
      - tvOS 17.4
      - visionOS 1.1
      - watchOS 10.4
  Android SDK: Not Found
IDEs:
  Android Studio: 2022.3 AI-223.8836.35.2231.10671973
  Xcode:
    version: 15.3/15E204a
    path: /usr/bin/xcodebuild
Languages:
  Java:
    version: 17.0.10
    path: /usr/bin/javac
  Ruby:
    version: 2.7.6
    path: /Users/MITCHMX20/.rbenv/shims/ruby
npmPackages:
  "@react-native-community/cli": Not Found
  react:
    installed: 18.2.0
    wanted: 18.2.0
  react-native:
    installed: 0.73.6
    wanted: 0.73.6
  react-native-macos: Not Found
npmGlobalPackages:
  "*react-native*": Not Found
Android:
  hermesEnabled: true
  newArchEnabled: false
iOS:
  hermesEnabled: true
  newArchEnabled: true


### Stacktrace or Logs

```text
n/a

Reproducer

https://github.com/react-native-community/reproducer-react-native

Screenshots and Videos

Screen.Recording.2024-03-18.at.5.18.36.PM.mp4
@cortinico
Copy link
Contributor

Is your app using react-native-screens under the hood? If so, the problem is the same as this one:

Which has already been resolved in 0.74

@omniphx
Copy link
Author

omniphx commented Mar 19, 2024

Confirmed that upgrading to RN 0.74 fixed it! Thanks @cortinico

@omniphx omniphx closed this as completed Mar 19, 2024
@github-actions github-actions bot added Needs: Attention Issues where the author has responded to feedback. and removed Needs: Author Feedback labels Mar 19, 2024
@cortinico
Copy link
Contributor

Amazing :)

@cortinico cortinico added Resolution: Answered When the issue is resolved with a simple answer and removed Needs: Attention Issues where the author has responded to feedback. labels Mar 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Resolution: Answered When the issue is resolved with a simple answer Type: New Architecture Issues and PRs related to new architecture (Fabric/Turbo Modules)
Projects
None yet
Development

No branches or pull requests

2 participants