react / react/react-native

【Android】Touch event misbehavior with multiple touch points

Offen
#53,005 2 Kommentare 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen

Dieses Issue hat noch niemand übernommen.

Issue: Author Provided Repro Platform: Android
Vorherrschende Sprache
C++
Sterne
127k
Forks
25.3k
Ø Merge
1 T. 23 Std.
Gemergte PRs (30 T.)
4

Beschreibung

Description

When I have multiple touch points on Android, events are mistakenly triggered.

In my case, when I place my finger on view A, which is bound to touch events, if I do not release my finger and place another finger on view B, the touch event for view A is triggered again, even though the second finger is on a different view.

I tested the behavior on iOS, and with the same operation, if my other finger is on view B, the touch event for view A is not triggered. Only if the other finger is also placed on view A will the touch event for view A be triggered again.

I also tried using TouchableWithoutFeedback, Pressable, and encountered the same issue on Android.

Steps to reproduce
  1. Install the app
  2. Place one finger on a view that is bound to an event and keep it there, then place another finger on a view that is not bound to any event to reproduce the issue
React Native Version

0.80.1

Affected Platforms

Runtime - Android

Output of npx @react-native-community/cli info
System:
  OS: macOS 14.2.1
  CPU: (8) arm64 Apple M3
  Memory: 135.97 MB / 16.00 GB
  Shell:
    version: "5.9"
    path: /bin/zsh
Binaries:
  Node:
    version: 23.10.0
    path: ~/.nvm/versions/node/v23.10.0/bin/node
  Yarn:
    version: 1.22.22
    path: /usr/local/bin/yarn
  npm:
    version: 10.9.2
    path: ~/.nvm/versions/node/v23.10.0/bin/npm
  Watchman:
    version: 2024.10.21.00
    path: /usr/local/bin/watchman
Managers:
  CocoaPods:
    version: 1.15.2
    path: /usr/local/bin/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: 2023.3 AI-233.14808.21.2331.11709847
  Xcode:
    version: 15.3/15E204a
    path: /usr/bin/xcodebuild
Languages:
  Java:
    version: 17.0.11
    path: /usr/bin/javac
  Ruby:
    version: 3.1.0
    path: /Users/didi/.rbenv/shims/ruby
npmPackages:
  "@react-native-community/cli":
    installed: 19.0.0
    wanted: 19.0.0
  react:
    installed: 19.1.0
    wanted: 19.1.0
  react-native:
    installed: 0.80.1
    wanted: 0.80.1
  react-native-macos: Not Found
npmGlobalPackages:
  "*react-native*": Not Found
Android:
  hermesEnabled: true
  newArchEnabled: true
iOS:
  hermesEnabled: true
  newArchEnabled: true
Stacktrace or Logs
no logs
MANDATORY Reproducer

https://github.com/yandadaFreedom/reproducer-react-native-0.80.1/tree/bug-android-multi-point-event

Screenshots and Videos

No response

Beitragsleitfaden

Beitragsleitfaden öffnen

Erste Schritte

  1. Lies das ganze Issue und danach den Beitragsleitfaden des Projekts.
  2. Schreib ins Issue, dass du es übernimmst — das erspart doppelte Arbeit.
  3. Forke das Repository und arbeite in einem Branch.
  4. Öffne einen Pull Request, der die Issue-Nummer nennt.

Rechercherichtung

Beginne mit dem obligatorischen Reproducer unter yandadaFreedom/reproducer-react-native-0.80.1, installiere die App und reproduziere die Multi-Touch-Sequenz auf Android. Verfolge die Verarbeitung der Touch-Events, die an TouchableWithoutFeedback und Pressable beteiligt ist, und überprüfe anschließend, dass ein zweiter Finger auf einer nicht verwandten View die erste View nicht erneut auslöst, während ein zweiter Finger auf derselben View dies tut.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Bewertung

Tech-Stack
android, react-native
Bereich
mobile
Issue-Typ
Bug
Schwierigkeit
4/5
Geschätzter Aufwand
3-5 Tage
Aktivitätsstatus
Veraltet
Klarheit
Größtenteils klar
Anfängerfreundlichkeit
35/100

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.