Skip to content

Commit 3b75d5d

Browse files
authored
fix: check if next and current indices are different before animating to a snap position (#1095)(by @itsramiel)
1 parent 8fc11fd commit 3b75d5d

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

src/components/bottomSheet/BottomSheet.tsx

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1315,7 +1315,10 @@ const BottomSheetComponent = forwardRef<BottomSheet, BottomSheetProps>(
13151315
* if snap points changed while sheet is animating, then
13161316
* we stop the animation and animate to the updated point.
13171317
*/
1318-
if (animatedAnimationState.value === ANIMATION_STATE.RUNNING) {
1318+
if (
1319+
animatedAnimationState.value === ANIMATION_STATE.RUNNING &&
1320+
animatedNextPositionIndex.value !== animatedCurrentIndex.value
1321+
) {
13191322
nextPosition =
13201323
animatedNextPositionIndex.value !== -1
13211324
? snapPoints[animatedNextPositionIndex.value]

0 commit comments

Comments
 (0)