react / react/react-native

ScrollView starts scrolled to bottom inside Modal if Pressable inside

Open
#43,187 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Component: Modal Component: ScrollView Issue: Author Provided Repro
Dominant language
C++
Stars
127k
Forks
25.3k
Avg merge
1d 23h
Merged PRs (30d)
4

Description

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

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by running the linked Snack reproducer on the web with the reported React Native version, using the Modal, ScrollView, and bottom Pressable described in the steps. Trace the web behavior that determines the ScrollView's initial position; done means the Modal opens at the top of the content rather than scrolled to the bottom.

Written by the indexing model from the issue text.

Assessment

Tech stack
react-native
Domain
frontend, web-dev
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.