Skip to content

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

Open

Description

@KisaneNeko

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

ios-blank-page-after-setpage.mp4

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

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions