react / react/react-native

ScrollView starts scrolled to bottom inside Modal if Pressable inside

Offen
#43,187 0 Kommentare 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen

Dieses Issue hat noch niemand übernommen.

Component: Modal 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

If I use a ScrollView with an Pressable at the end of content container inside a Modal, the scroll position is initially at the bottom.
Here is a minimal example: https://snack.expo.dev/ZmDt9FQIQjzw0x8SM6-XD

Steps to reproduce
  1. Create a Modal
  2. Inside create a Scrollview and fill content
  3. Add Pressable at bottom
  4. Open Modal with ScrollView
React Native Version

0.73.4

Affected Platforms

Runtime - Web

Output of npx react-native info
System:
  OS: Windows 11 10.0.22621
  CPU: (16) x64 AMD Ryzen 7 PRO 4750U with Radeon Graphics
  Memory: 3.74 GB / 15.37 GB
Binaries:
  Node:
    version: 20.9.0
    path: C:\Program Files\nodejs\node.EXE
  Yarn: Not Found
  npm:
    version: 9.3.1
    path: C:\Program Files\nodejs\npm.CMD
  Watchman: Not Found
SDKs:
  Android SDK: Not Found
  Windows SDK: Not Found
IDEs:
  Android Studio: AI-223.8836.35.2231.11090377
  Visual Studio: Not Found
Languages:
  Java:
    version: 17.0.10
    path: C:\Program Files\Eclipse Foundation\jdk-17.0.10\bin\javac.EXE
  Ruby: Not Found
npmPackages:
  "@react-native-community/cli": Not Found
  react:
    installed: 18.2.0
    wanted: 18.2.0
  react-native:
    installed: 0.73.4
    wanted: 0.73.4
  react-native-windows: Not Found
npmGlobalPackages:
  "*react-native*": Not Found
Android:
  hermesEnabled: true
  newArchEnabled: false
iOS:
  hermesEnabled: Not found
  newArchEnabled: Not found
Stacktrace or Logs
-
Reproducer

https://snack.expo.dev/ZmDt9FQIQjzw0x8SM6-XD

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 damit, den verknüpften Snack-Reproducer im Web mit der gemeldeten React Native-Version auszuführen, wobei du das in den Schritten beschriebene Modal, ScrollView und die unten befindliche Pressable verwendest. Verfolge das Webverhalten, das die anfängliche Position der ScrollView bestimmt; abgeschlossen ist die Aufgabe, wenn das Modal am Anfang des Inhalts geöffnet wird, statt bis zum Ende gescrollt zu sein.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Bewertung

Tech-Stack
react-native
Bereich
frontend, web-dev
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.