ScrollView starts scrolled to bottom inside Modal if Pressable inside
未关闭
还没有人认领这个 Issue。
Component: Modal
Component: ScrollView
Issue: Author Provided Repro
- 主要语言
- C++
- 星标
- 127k
- 派生
- 25.3k
- 平均合并
- 1 天 23 小时
- 30 天内合并 PR
- 4
描述
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
- Create a Modal
- Inside create a Scrollview and fill content
- Add Pressable at bottom
- 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
贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
调研方向
首先,在 Web 上使用报告的 React Native 版本运行链接的 Snack reproducer,并使用步骤中描述的 Modal、ScrollView 和底部的 Pressable。跟踪决定 ScrollView 初始位置的 Web 行为;完成标准是 Modal 打开在内容顶部,而不是已经滚动到底部。
由索引模型根据 Issue 内容生成。
评估
- 技术栈
- react-native
- 领域
- frontend, web-dev
- Issue 类型
- 缺陷
- 难度
- 4/5
- 预计耗时
- 3-5 天
- 活跃度
- 停滞
- 描述清晰度
- 基本清楚
- 新手友好度
- 35/100