react / react/react-native

`ScrollView` `contentContainerStyle`'s `flexGrow` doesn't account for `contentInsetAdjustmentBehavior` or `automaticallyAdjustKeyboardInsets`

Offen
#46,722 2 Kommentare 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen

Dieses Issue hat noch niemand übernommen.

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

Beschreibung

Description

This is a reopen of https://github.com/facebook/react-native/issues/25282 which is still reproducible in the latest React native version.

Steps to reproduce
  1. Create a ScrollView with contentInsetAdjustmentBehavior="automatic" and contentContainerStyle={{flexGrow: 1}}.
  2. Observe that the content container grows larger than the ScrollView's height, while the height is expected to match, because safe area insets would be accounted for.

See the Expo snack

React Native Version

0.75.3

Affected Platforms

Runtime - iOS

Output of npx react-native info
N/A — easy to reproduce
Stacktrace or Logs
N/A
Reproducer

https://snack.expo.dev/@louay/scrollview-layout-contentinset-issue

Screenshots and Videos

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 verlinkten Expo Snack und reproduziere das iOS-Verhalten mit ScrollView, contentContainerStyle={{flexGrow: 1}}, contentInsetAdjustmentBehavior="automatic" und automaticallyAdjustKeyboardInsets. Fertig ist die Aufgabe, wenn die Höhe des Content-Containers die relevanten Insets berücksichtigt, anstatt über die Höhe von ScrollView hinauszuwachsen.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Bewertung

Tech-Stack
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.