Hacktoberfest 2026:维护者为十月标记出来的 issue,仍然开放、适合新手。 浏览 Hacktoberfest issue

[iOS] Page is blank after setPage when the screen re-renders on pager events

未关闭
#1,202 0 条评论 1 个 reaction 已指派 0 人 在 GitHub 查看

维护者通常 1 天内回复

@KisaneNeko 已经在做这个了。

开始于 2026年10月26日。

  • #1203 来自 @KisaneNeko —— 未关闭

评估

难度
4/5
预计耗时
3-5 天
新手友好度
35/100
Issue 类型
缺陷
描述清晰度
描述清楚
活跃度
停滞
技术栈
ios, react-native, typescript
领域
frontend, mobile

调研方向

Start with the #1154 repro screen at example/src/gh-issues/Issue1154PageChangeFocusRepro.tsx and apply the two event-log changes described in the issue. Run the six-step sequence on an iOS simulator using version 9.0.10. The issue is resolved when page 2 remains visible after the final steps; linked pull request #1203 is already open.

由索引模型根据 Issue 内容生成。

描述

On iOS, the pager can show an empty page after setPage. The status line says the page is selected, but the pager area is empty: no text and no inputs. The page stays empty after the pager stops moving.

This surfaced while reviewing #1193 (the iOS focus fix). The repro screen in that PR triggers it. #1193 does not cause it, because the same steps show a blank page on 9.0.10 without that PR.

Repro

Use the #1154 repro screen (example/src/gh-issues/Issue1154PageChangeFocusRepro.tsx) on main, with two changes. Each change makes the event log above the pager change length when the pager changes page:

// In the "Go N" buttons, before setPage:
setEvents([]);

// On the PagerView:
onPageScrollStateChanged={(e) => {
  if (e.nativeEvent.pageScrollState === 'idle') {
    log('state idle');
  }
}}

Then:

  1. Tap the input on page 0, type a few characters, and tap Go 1.
  2. Tap the input on page 1, type, and tap Go 2.
  3. Tap the input on page 2, type, and tap Go 1.
  4. Tap the input on page 1, type, and tap Go 0.
  5. Tap the input on page 0, type, and tap Go 1.
  6. Tap Go 2.

Expected: page 2 shows.
Actual: the status line says Selected: 2, but the pager area is empty.

Each part is needed. Without the two changes, without typing, without focusing the inputs, or without the first step, the page shows correctly.

Recording

https://github.com/user-attachments/assets/8381b1be-60ca-4cf6-b940-c5ebd8eb72eb

Versions: react-native-pager-view 9.0.10 (main at 4914ab6), iOS 26.5 simulator (iPhone 17 Pro Max), iOS only.

主要语言
TypeScript
星标
3.4k
派生
490
平均合并
2 天 5 小时
30 天内合并 PR
34

环境准备

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

callstack/react-native-pager-view 的其他 Issue

查看 callstack/react-native-pager-view 的全部 Issue

相似的 Issue

更多 TypeScript Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。