react / react/react-native

[iOS] Touch events fire on underlying views while UIActivityViewController (Share Sheet) is presented

Abierto
#56,200 0 comentarios 0 reacciones 0 asignados Ver en GitHub

Nadie ha tomado este issue todavía.

API: Share Needs: Triage :mag: Platform: iOS
Lenguaje dominante
C++
Estrellas
127k
Forks
25.3k
Merge medio
1 d 23 h
PR fusionados (30 d)
4

Descripción

Description

⚠️ Physical device only. This bug does not reproduce on the iOS Simulator.

On physical iOS devices, when Share.share() or ActionSheetIOS.showShareActionSheetWithOptions() presents a UIActivityViewController, tapping outside the share sheet to dismiss it also triggers touch events on the underlying RN views. For example, tapping above the share sheet to close it will fire onPress on anyPressable, TouchableOpacity, or other touch target at that screen position. In native iOS apps, this dismiss tap is consumed and does not reach the content underneath.

Real-world impact:

This bug is currently active in major production React Native apps on physical devices. For example, in Bluesky and Shop (by Shopify), if a user opens the iOS Share Sheet and taps the background to dismiss it, they can accidentally trigger background actions (like navigating, liking a post, or tapping a button).

Suspected root cause:

RN's touch system (RCTTouchHandler) processes events independently from UIKit's responder chain. When a native view controller is presented over the RN view hierarchy, UIKit knows not to deliver touches to the background — but RN's parallel touch system is unaware of the presentation and continues dispatching events.

I believe this same root cause affects other native iOS overlays outside the RN view hierarchy that rely on "touch outside" behavior to close, for example:

Steps to reproduce
  1. Open the Snack on a physical iOS device (⚠️ this bug does NOT reproduce on Simulator — only real hardware)
  2. Tap "Share.share()" to open the share sheet
  3. Wait for the share sheet to fully present (~0.8 seconds)
  4. Tap any touch target in the upper portion of the screen (Pressable, TouchableOpacity, etc.)
  5. Expected: Touches blocked by the share sheet
  6. Actual: "Tapped" alert fires — touch passes through to the underlying view
React Native Version

0.84.1

Affected Platforms

Runtime - iOS

Output of npx @react-native-community/cli info
System:
    OS: macOS 26.2
    CPU: (10) arm64 Apple M4
    Memory: 161.16 MB / 32.00 GB
    Shell:
      version: 3.2.57
      path: /bin/bash
  Binaries:
    Node:
      version: 22.22.1
      path: /Users/jaronheard/Library/Caches/fnm_multishells/33861_1774296117289/bin/node
    Yarn:
      version: 1.22.19
      path: /opt/homebrew/bin/yarn
    npm:
      version: 10.9.4
      path: /Users/jaronheard/Library/Caches/fnm_multishells/33861_1774296117289/bin/npm
    Watchman:
      version: 2025.04.14.00
      path: /opt/homebrew/bin/watchman
  Managers:
    CocoaPods:
      version: 1.16.2
      path: /opt/homebrew/lib/ruby/gems/3.4.0/bin/pod
  SDKs:
    iOS SDK:
      Platforms:
        - DriverKit 25.2
        - iOS 26.2
        - macOS 26.2
        - tvOS 26.2
        - visionOS 26.2
        - watchOS 26.2
    Android SDK: Not Found
  IDEs:
    Android Studio: Not Found
    Xcode:
      version: 26.3/17C529
      path: /usr/bin/xcodebuild
  Languages:
    Java:
      version: 17.0.11
      path: /usr/bin/javac
    Ruby:
      version: 3.4.2
      path: /opt/homebrew/opt/ruby/bin/ruby
  npmPackages:
    "@react-native-community/cli":
      installed: 20.1.0
      wanted: 20.1.0
    react:
      installed: 19.2.3
      wanted: 19.2.3
    react-native:
      installed: 0.84.1
      wanted: 0.84.1
    react-native-macos: Not Found
  npmGlobalPackages:
    "*react-native*": Not Found
  Android:
    hermesEnabled: true
    newArchEnabled: true
  iOS:
    hermesEnabled: true
    newArchEnabled: true
Stacktrace or Logs
N/A
MANDATORY Reproducer

https://snack.expo.dev/@jaronheard/da36c0

Screenshots and Videos
Bluesky Shop (Shopify) Reproducer Snack
Bluesky Shop Reproducer
Tap passes through share sheet and navigates to Profile tab Tap passes through share sheet and triggers the favorite/like button Tap passes through share sheet and fires Pressable onPress alert

Guía de contribución

Abrir la guía de contribución

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Línea de trabajo

Comienza con el reproductor obligatorio de Snack en un dispositivo iOS físico y, después, inspecciona RCTTouchHandler de RN y la ruta de presentación del share sheet descrita en el issue. Se considera terminado cuando descartar UIActivityViewController tocando fuera de él ya no dispara eventos táctiles en las vistas Pressable o TouchableOpacity subyacentes; verifica el comportamiento en hardware real, no en Simulator.

Escrito por el modelo de indexación a partir del texto del issue.

Evaluación

Stack tecnológico
ios, react-native
Área
mobile
Tipo de issue
Error
Dificultad
4/5
Tiempo estimado
3-5 días
Estado de actividad
Tranquilo
Claridad
Bastante claro
Aptitud para principiantes
48/100

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.