Skip to content

Commit ceb3671

Browse files
committed
fix: only animate on RESIZE if the source = element
1 parent 383e206 commit ceb3671

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/BottomSheet.tsx

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -370,7 +370,10 @@ export const BottomSheet = React.forwardRef<
370370
maxHeight: maxHeightRef.current,
371371
maxSnap: maxSnapRef.current,
372372
minSnap: minSnapRef.current,
373-
immediate: prefersReducedMotion.current,
373+
immediate:
374+
resizeSourceRef.current === 'element'
375+
? prefersReducedMotion.current
376+
: true,
374377
})
375378
}, [asyncSet, lastSnapRef, prefersReducedMotion]),
376379
closeSmoothly: useCallback(

0 commit comments

Comments
 (0)