[iOS] setPage does not animate when the pager resizes with the keyboard
Maintainer antworten meist innerhalb von 1 Tag
Bewertung
- Schwierigkeit
- 4/5
- Geschätzter Aufwand
- 3-5 Tage
- Anfängerfreundlichkeit
- 52/100
- Issue-Typ
- Bug
- Klarheit
- Größtenteils klar
- Aktivitätsstatus
- Aktiv
- Tech-Stack
- ios, react-native, swift, typescript
Rechercherichtung
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.
Vom Indexierungsmodell aus dem Issue-Text verfasst.
Beschreibung
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.
- Vorherrschende Sprache
- TypeScript
- Sterne
- 3.4k
- Forks
- 491
- Ø Merge
- 2 T. 4 Std.
- Gemergte PRs (30 T.)
- 51
Entwicklungsumgebung
- Kein Dockerfile und keine Docker-Compose-Datei
- Hat eine Pull-Request-Vorlage
- Beitragsleitfaden lesen
Erste Schritte
- Lesen Sie das ganze Issue und danach den Beitragsleitfaden des Projekts.
- Schreiben Sie ins Issue, dass Sie es übernehmen — das erspart doppelte Arbeit.
- Forken Sie das Repository und arbeiten Sie in einem Branch.
- Öffnen Sie einen Pull Request, der die Issue-Nummer nennt.
Mehr aus callstack/react-native-pager-view
-
Schwierigkeit 4/5 3-5 Tage Anfängerfreundlichkeit 55/100
callstack/react-native-pager-view#1232 · 2 Reaktionen ·
Maintainer antworten meist innerhalb von 1 Tag
-
[iOS] UIKit's scroll to a focused field can leave the pager between pagesEvtl. vergeben @TaduJR hat das vor 2 Tagen übernommen. Offen
Schwierigkeit 4/5 3-5 Tage Anfängerfreundlichkeit 52/100
callstack/react-native-pager-view#1230 · 4 Kommentare ·
Maintainer antworten meist innerhalb von 1 Tag
-
Resolution: Needs Repro
Schwierigkeit 4/5 3-5 Tage Anfängerfreundlichkeit 32/100
callstack/react-native-pager-view#1222 · 2 Kommentare · 1 Reaktion ·
Maintainer antworten meist innerhalb von 1 Tag
-
Schwierigkeit 3/5 1-2 Tage Anfängerfreundlichkeit 58/100
callstack/react-native-pager-view#1189 ·
Maintainer antworten meist innerhalb von 1 Tag
-
iOS: PagerScrollDelegate proxies to itself and overflows the stack when the weak originalDelegate diesEvtl. vergeben @lvlrSajjad hat das vor 56 Tagen übernommen. Offen
Schwierigkeit 4/5 3-5 Tage Anfängerfreundlichkeit 25/100
callstack/react-native-pager-view#1146 ·
Maintainer antworten meist innerhalb von 1 Tag
Alle Issues in callstack/react-native-pager-view
Ähnliche Issues
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 74/100
earendil-works/pi-claude-code#36 ·
Maintainer antworten meist innerhalb von 6 Tagen
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 65/100
Maintainer antworten meist innerhalb von 1 Tag
-
Resources: New work of jabodetabekEvtl. vergeben @rmt-svc hat das heute übernommen. Offenresources
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 62/100
railmapgen/rmp-gallery#4167 ·
Maintainer antworten meist innerhalb von 2 Tagen
-
documentation p1
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 75/100
Maintainer antworten meist innerhalb von 1 Tag
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 83/100
microsoft/monaco-editor#5577 ·
Maintainer antworten meist innerhalb von 1 Tag