[iOS] setPage does not animate when the pager resizes with the keyboard
维护者通常 1 天内回复
评估
- 难度
- 4/5
- 预计耗时
- 3-5 天
- 新手友好度
- 52/100
- Issue 类型
- 缺陷
- 描述清晰度
- 基本清楚
- 活跃度
- 活跃
- 技术栈
- ios, react-native, swift, typescript
调研方向
Read the iOS pager implementation and the focus-clearing change from #1193, then reproduce the two-command sequence in the Issue #1154 Page Change Focus Repro screen using a release build. Compare the pager's scroll frames with the keyboard closed and open to trace why the selection loses its animation after the layout pass. Done means repeated keyboard-up setPage calls slide while still landing on the requested page.
由索引模型根据 Issue 内容生成。
描述
Environment
react-native-pager-view:main- React Native 0.88.0, new architecture
- iPhone 18 Pro simulator, iOS 27.0
Description
An imperative setPage does not animate when the pager's height changes while the command is in flight: the page changes instantly instead of sliding.
The resize is what breaks it, not the focus. Flipping a 40 pt spacer above the pager in the handler that calls setPage jumps the same way with no keyboard anywhere, and that part is not new. What #1193 changed is that an app no longer has to resize anything itself: leaving a page resigns its input, the keyboard closes, and a pager that sizes itself around the keyboard springs back to full height a frame after the command.
Counting the pager's scroll frames per command, where a slide reports about 18 and a jump 1, with the pager inside a KeyboardAvoidingView and an input focused before each of three moves: 1, 1, 1. Removing the blur that #1193 added to setPage, and nothing else, puts it back to a 230 ms slide a move. The keyboard then closes once the pager settles instead of during the command.
The heights at each step, from the pager's own layout pass:
setPage index=1 h=225
layout h=437 +17 ms
scroll h=225 x1
Reproducible Demo
<KeyboardAvoidingView behavior="padding" style={{ flex: 1 }}>
<Button title="Go 1" onPress={() => pagerRef.current?.setPage(1)} />
<PagerView ref={pagerRef} style={{ flex: 1 }}>
{/* one page per colour, each holding a TextInput */}
</PagerView>
</KeyboardAvoidingView>
- Focus the input on page 0 so the keyboard opens
- Tap Go 1
- The page changes with no slide. With the keyboard closed the same tap slides
The example screen resizes itself for an unrelated reason. Its Events: line wraps as the log grows and Go N clears it in the same handler as the command, so its steps do not isolate this one.
- 主要语言
- TypeScript
- 星标
- 3.4k
- 派生
- 491
- 平均合并
- 2 天 4 小时
- 30 天内合并 PR
- 51
环境准备
- 没有 Dockerfile 或 Docker Compose 文件
- 有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
callstack/react-native-pager-view 的其他 Issue
-
难度 4/5 3-5 天 新手友好度 55/100
callstack/react-native-pager-view#1232 · 2 个 reaction ·
维护者通常 1 天内回复
-
[iOS] UIKit's scroll to a focused field can leave the pager between pages可能已有人在做 @TaduJR 于 2 天前认领。 未关闭
难度 4/5 3-5 天 新手友好度 52/100
callstack/react-native-pager-view#1230 · 4 条评论 ·
维护者通常 1 天内回复
-
Resolution: Needs Repro
难度 4/5 3-5 天 新手友好度 32/100
callstack/react-native-pager-view#1222 · 2 条评论 · 1 个 reaction ·
维护者通常 1 天内回复
-
难度 3/5 1-2 天 新手友好度 58/100
callstack/react-native-pager-view#1189 ·
维护者通常 1 天内回复
-
iOS: PagerScrollDelegate proxies to itself and overflows the stack when the weak originalDelegate dies可能已有人在做 @lvlrSajjad 于 56 天前认领。 未关闭
难度 4/5 3-5 天 新手友好度 25/100
callstack/react-native-pager-view#1146 ·
维护者通常 1 天内回复
查看 callstack/react-native-pager-view 的全部 Issue
相似的 Issue
-
难度 2/5 1-3 小时 新手友好度 74/100
earendil-works/pi-claude-code#36 ·
维护者通常 6 天内回复
-
难度 2/5 1-3 小时 新手友好度 65/100
维护者通常 1 天内回复
-
Resources: New work of jabodetabek可能已有人在做 @rmt-svc 今天认领。 未关闭resources
难度 2/5 1-3 小时 新手友好度 62/100
railmapgen/rmp-gallery#4167 ·
维护者通常 2 天内回复
-
documentation p1
难度 2/5 1-3 小时 新手友好度 75/100
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 83/100
microsoft/monaco-editor#5577 ·
维护者通常 1 天内回复