fix: restore Android native stretchy overscroll on image carousel (#11072)

This commit is contained in:
Pintu
2026-07-06 21:17:24 +05:30
committed by GitHub
parent e5d2ee3315
commit ff78d32288
+6 -3
View File
@@ -274,9 +274,12 @@ export function Gallery({
aria-label={l`Image gallery, ${images.length} images`}
horizontal
pagingEnabled={false}
// Disable Android's stretch overscroll, which can leave the carousel
// settled just off the left edge instead of aligned to x = 0
overScrollMode={IS_ANDROID ? 'never' : 'auto'}
// We use snapToOffsets on Android to ensure that if the stretch overscroll
// leaves the carousel slightly off the left edge, it snaps back to 0.
// This fixes the offset bug without disabling the native stretch behavior.
overScrollMode="auto"
snapToOffsets={IS_ANDROID ? [0] : undefined}
snapToEnd={false}
showsHorizontalScrollIndicator={false}
directionalLockEnabled
nestedScrollEnabled