react / react/react-native

[iOS] The caret goes under the keyboard in multiline TextInput after the ScrollView auto-scrolls to the caret

Aperta
#52,414 8 commenti 2 reazioni 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

API: Keyboard Component: ScrollView Component: TextInput Issue: Author Provided Repro Platform: iOS
Lingua principale
C++
Stelle
127k
Fork
25.3k
Merge medio
1g 23h
PR unite (30g)
4

Descrizione

Description

On iOS, when using a multiline TextInput inside a ScrollView with automaticallyAdjustKeyboardInsets, the caret goes under the keyboard after adding a new line in the input.

Steps to reproduce
<ScrollView automaticallyAdjustKeyboardInsets>
   // Any content above the TextInput to position it at the bottom of the screen
   <TextInput multiline style={{ height: 100 }} /> // multiline TextInput with some fixed height
</ScrollView>
  1. ScrollView with automaticallyAdjustKeyboardInsets (with enough content to fill the whole screen).
  2. Multiline TextInput with fixed height (let's say 100).
  3. Focus on the input when it’s positioned at the bottom of the screen.
  4. Let the keyboard slide up and the ScrollView scroll to the caret.
  5. Type more than 1 line in the TextInput.
  6. The TextInput caret goes under the keyboard
  7. Once the TextInput fills the available height, it starts scrolling, but the user only sees the first line of the input
React Native Version

0.79.5

Affected Platforms

Runtime - iOS

Output of npx @react-native-community/cli info
This is not relevant
Stacktrace or Logs
This is not relevant
MANDATORY Reproducer

https://snack.expo.dev/@serge0n/textinput-multiline-autoscroll-on-new-line?platform=ios

Screenshots and Videos

https://github.com/user-attachments/assets/954d5545-3d89-4ef2-91d8-15214b4fffbe

Guida per i contributori

Apri la guida per i contributori

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Direzione di ricerca

Inizia eseguendo il riproduttore Snack collegato su iOS e traccia l'interazione tra automaticallyAdjustKeyboardInsets di ScrollView e il TextInput multilinea. Confronta la visibilità del cursore prima e dopo l'inserimento di una nuova riga; il lavoro è completato quando il cursore rimane sopra la tastiera e il testo visibile segue il cursore man mano che l'input si riempie.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Valutazione

Stack tecnologico
ios, react-native
Ambito
mobile
Tipo di issue
Bug
Difficoltà
4/5
Tempo stimato
3-5 giorni
Stato di attività
Ferma
Chiarezza
Abbastanza chiara
Idoneità per principianti
35/100

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.