Hacktoberfest 2026: die Issues, die Maintainer für den Oktober markiert haben – offen und einsteigerfreundlich. Hacktoberfest-Issues durchsuchen

`TextInput` emits `onChange` event with invalid `selection` on Android browser autofill

Offen
#57,458 1 Kommentar 3 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen

Dieses Issue hat noch niemand übernommen.

Bewertung

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

Rechercherichtung

Führe zunächst den obligatorischen Reproducer mit npm ci und npm start aus und konzentriere dich dann auf den TextInput-onChange-Ereignispfad für das Android-Browser-/System-Autofill. Als erledigt gilt die Aufgabe, wenn autofillierter Text eine Auswahl am Ende des eingefügten Werts meldet, während eingefügte Eingaben und das iOS-Verhalten unverändert bleiben.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Beschreibung

Component: TextInput Needs: Triage :mag: Platform: Android
Description

On Android, filling a TextInput via browser/system autofill emits an onChange event whose nativeEvent.selection is {start: 0, end: 0} instead of pointing to the end of the inserted text.

The text is correct, but the selection is wrong — the cursor is reported at the start of the field rather than after the autofilled value. The same input entered by pasting (from clipboard) reports the correct selection, and iOS reports the correct selection for both paste and autofill.

<TextInput
  autoComplete="tel"
  onChange={console.log}
/>
Expected vs. actual

iPhone 17 (iOS 26.5) — correct in both cases

✅ Paste +1 (555) 123-4567:

nativeEvent: {
  text: '+1 (555) 123-4567',
  selection: { start: 17, end: 17 }
}

✅ Browser autofill +1 (555) 123-4567:

nativeEvent: {
  text: '+1 (555) 123-4567',
  selection: { start: 17, end: 17 } 
}

Pixel 10 Pro XL (Android 17.0) — autofill is broken

✅ Paste +15551234567:

nativeEvent: {
  text: '+15551234567',
  selection: { start: 12, end: 12 }
}

❌ Browser autofill +15551234567:

nativeEvent: {
  text: '+15551234567',
  selection: { start: 0, end: 0 }
  //         ~~~~~~~~~~~~~~~~~~~~
}

On Android, autofill reports selection: { start: 0, end: 0 } while the text length is 12.

Steps to reproduce
  1. Clone https://github.com/nsbarsukov/react-native-android-autofill-bug
  2. Run npm ci
  3. Run npm start
  4. Focus the input and trigger the browser/system autofill suggestion for a phone number.
React Native Version

0.86.0

Affected Platforms

Runtime - Android

Output of npx @react-native-community/cli info
System:
  OS: macOS 26.4.1
  CPU: (8) arm64 Apple M2
  Memory: 166.00 MB / 8.00 GB
  Shell:
    version: "5.9"
    path: /bin/zsh
Binaries:
  Node:
    version: 26.4.0
    path: /Users/nsbarsukov/.nvm/versions/node/v26.4.0/bin/node
  Yarn: Not Found
  npm:
    version: 11.17.0
    path: /Users/nsbarsukov/.nvm/versions/node/v26.4.0/bin/npm
  Watchman:
    version: 2026.06.08.00
    path: /opt/homebrew/bin/watchman
Managers:
  CocoaPods: Not Found
SDKs:
  iOS SDK:
    Platforms:
      - DriverKit 25.5
      - iOS 26.5
      - macOS 26.5
      - tvOS 26.5
      - visionOS 26.5
      - watchOS 26.5
  Android SDK: Not Found
IDEs:
  Android Studio: 2026.1 AI-261.23567.138.2611.15646644
  Xcode:
    version: 26.6/17F113
    path: /usr/bin/xcodebuild
Languages:
  Java: Not Found
  Ruby:
    version: 2.6.10
    path: /usr/bin/ruby
npmPackages:
  "@react-native-community/cli": Not Found
  react:
    installed: 19.2.3
    wanted: 19.2.3
  react-native:
    installed: 0.86.0
    wanted: 0.86.0
  react-native-macos: Not Found
npmGlobalPackages:
  "*react-native*": Not Found
Android:
  hermesEnabled: Not found
  newArchEnabled: Not found
iOS:
  hermesEnabled: Not found
  newArchEnabled: Not found
Stacktrace or Logs
nativeEvent: {
  text: '+15551234567',
  selection: { start: 0, end: 0 }
}
MANDATORY Reproducer

https://github.com/nsbarsukov/react-native-android-autofill-bug

Screenshots and Videos

https://github.com/user-attachments/assets/866d4fd3-3852-4ca3-8408-7c0d1b4c17f8

Vorherrschende Sprache
C++
Sterne
127k
Forks
25.3k
PR-Merge-Kennzahlen
Keine gemergten PRs in 30 T.

Beitragsleitfaden

Beitragsleitfaden öffnen

Erste Schritte

  1. Lesen Sie das ganze Issue und danach den Beitragsleitfaden des Projekts.
  2. Schreiben Sie ins Issue, dass Sie es übernehmen — das erspart doppelte Arbeit.
  3. Forken Sie das Repository und arbeiten Sie in einem Branch.
  4. Öffnen Sie einen Pull Request, der die Issue-Nummer nennt.

Mehr aus react/react-native

Alle Issues in react/react-native

Ähnliche Issues

Weitere Issues zu C++

Neue Issues direkt in Ihr Postfach

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