react / react/react-native

[iOS] The scroll position of the multiline TextInput affects the ScrollView auto-scroll when the keyboard opens/closes

Offen
#52,416 1 Kommentar 2 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen

Dieses Issue hat noch niemand übernommen.

API: Keyboard Component: ScrollView Component: TextInput Issue: Author Provided Repro
Vorherrschende Sprache
C++
Sterne
127k
Forks
25.3k
Ø Merge
1 T. 23 Std.
Gemergte PRs (30 T.)
4

Beschreibung

Description

On iOS, when using a ScrollView with automaticallyAdjustKeyboardInsets and a multiline TextInput, the scroll position of the TextInput affects how the ScrollView auto-scrolls when the keyboard opens or closes.

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 fixed height and many lines of text (let say 20)
   // More content to allow the ScrollView to scroll if needed
</ScrollView>
  1. ScrollView with automaticallyAdjustKeyboardInsets
  2. Content above the TextInput to fill the screen
  3. Multiline TextInput with fixed height and many lines of text
  4. Content below the TextInput to allow the ScrollView to scroll if needed
  5. Focus on the input and scroll it to the end
  6. Scroll the ScrollView to align the TextInput at the bottom of the screen
  7. Focus on the last line in the TextInput
  8. The keyboard slides up, and the ScrollView scrolls too much
  9. With the keyboard open, scroll the ScrollView to align the TextInput at the bottom of the screen (above the keyboard)
  10. Close the keyboard
  11. The ScrollView scrolls up
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/the-scroll-position-of-the-multiline-textinput-affects-the-scrollview-auto-scroll-when-the-keyboard-opens-or-closes?platform=ios

Screenshots and Videos

https://github.com/user-attachments/assets/1566ea6e-e936-4670-a18a-80090857f58c

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 iOS Snack-Reproducer und vergleiche das Verhalten von ScrollView und multiline TextInput beim Öffnen und Schließen der Tastatur. Verfolge die Verarbeitung von automaticallyAdjustKeyboardInsets und überprüfe anschließend, dass ScrollView beim Öffnen der Tastatur nicht mehr zu weit scrollt oder sich beim Schließen nach oben verschiebt.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Bewertung

Tech-Stack
ios, 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
42/100

Neue Issues direkt in Ihr Postfach

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