From ff78d322888db5f0a485eb2b69316287cd5be0c0 Mon Sep 17 00:00:00 2001 From: Pintu Date: Mon, 6 Jul 2026 21:17:24 +0530 Subject: [PATCH] fix: restore Android native stretchy overscroll on image carousel (#11072) --- src/components/images/Gallery/index.tsx | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/components/images/Gallery/index.tsx b/src/components/images/Gallery/index.tsx index a9d483398c..12067c2250 100644 --- a/src/components/images/Gallery/index.tsx +++ b/src/components/images/Gallery/index.tsx @@ -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