fix: restore Android native stretchy overscroll on image carousel (#11072)
This commit is contained in:
@@ -274,9 +274,12 @@ export function Gallery({
|
|||||||
aria-label={l`Image gallery, ${images.length} images`}
|
aria-label={l`Image gallery, ${images.length} images`}
|
||||||
horizontal
|
horizontal
|
||||||
pagingEnabled={false}
|
pagingEnabled={false}
|
||||||
// Disable Android's stretch overscroll, which can leave the carousel
|
// We use snapToOffsets on Android to ensure that if the stretch overscroll
|
||||||
// settled just off the left edge instead of aligned to x = 0
|
// leaves the carousel slightly off the left edge, it snaps back to 0.
|
||||||
overScrollMode={IS_ANDROID ? 'never' : 'auto'}
|
// This fixes the offset bug without disabling the native stretch behavior.
|
||||||
|
overScrollMode="auto"
|
||||||
|
snapToOffsets={IS_ANDROID ? [0] : undefined}
|
||||||
|
snapToEnd={false}
|
||||||
showsHorizontalScrollIndicator={false}
|
showsHorizontalScrollIndicator={false}
|
||||||
directionalLockEnabled
|
directionalLockEnabled
|
||||||
nestedScrollEnabled
|
nestedScrollEnabled
|
||||||
|
|||||||
Reference in New Issue
Block a user