callstack / callstack/react-native-pager-view
[iOS] pager content getting cropped on version 8.0.4
Nadie ha tomado este issue todavía.
- Lenguaje dominante
- TypeScript
- Estrellas
- 3.4k
- Forks
- 476
- Merge medio
- 10 d 21 h
- PR fusionados (30 d)
- 2
Descripción
Environment
react-native-pager-view: 8.0.4 (regression from 8.0.2)
react-native: 0.81.1
Architecture: Fabric (New Architecture)
Platform: iOS
Device: iPhone 16 Pro, portrait (reproduces on any device with a home-indicator safe area)
Tab bar: custom React Native bottom tab (not the system UITabBar)
Description
Regression in 8.0.4, introduced by #1085.
After upgrading 8.0.2 → 8.0.4, page content is cropped at the bottom on first render and only corrects after the first scroll.
Root cause (confirmed with native logging inside PageChildViewController):
propagateSafeArea() walks up to the nearest ancestor with a non-zero safe area and copies its safeAreaInsets into additionalSafeAreaInsets. The picked source is consistently the same view (_UIHostingView<_ViewList_View>), but its safeAreaInsets.bottom is not stable during layout — it flickers 49 → 24.33 while the hosting view's height settles through intermediate passes (730 → 681 → 656.66).
propagateSafeArea() samples this value mid-relayout and pins the transient 24.33, cropping the content. The 0.5pt guard doesn't help, since 49 → 24.33 is a large delta (the guard only prevents infinite layout loops, not incorrect values). A manual scroll forces a clean relayout back to 49, which is why the crop disappears after scrolling.
Trigger: the initial layout pass on first mount, and again whenever the page is relaid out. The inset is read while the hosting view's layout is still settling, so an intermediate value gets applied.
Expected: content uses the correct, stable bottom inset (49) on first render.
Actual: content is cropped using a transient inset (24.33) until the first scroll.
Reproducible Demo
Fabric app with a PagerView whose page contains a scrollable list.
The page is rendered inside a view whose height changes during initial layout (below a collapsing header or header height changes during layout).
On first load, the bottom of the content is cut off. Scroll once and it corrects.
Guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Línea de trabajo
Empieza siguiendo propagateSafeArea() desde PageChildViewController y compara la regresión introducida por issue #1085. Reproduce el layout de Fabric iOS con una página cuya altura cambia y verifica después que el inset inferior se mantenga estable y que el contenido no se recorte ni en el primer renderizado ni después del relayout.
Escrito por el modelo de indexación a partir del texto del issue.
Evaluación
- Stack tecnológico
- ios, react-native, typescript
- Área
- mobile
- Tipo de issue
- Error
- Dificultad
- 4/5
- Tiempo estimado
- 3-5 días
- Estado de actividad
- Activo
- Claridad
- Bastante claro
- Aptitud para principiantes
- 55/100