From ceb3671887409184924db814226a6355dd795dbe Mon Sep 17 00:00:00 2001 From: Cody Olsen Date: Thu, 21 Jan 2021 22:37:50 +0100 Subject: [PATCH] fix: only animate on RESIZE if the source = element --- src/BottomSheet.tsx | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/BottomSheet.tsx b/src/BottomSheet.tsx index 07a8d2f5..bdf50443 100644 --- a/src/BottomSheet.tsx +++ b/src/BottomSheet.tsx @@ -370,7 +370,10 @@ export const BottomSheet = React.forwardRef< maxHeight: maxHeightRef.current, maxSnap: maxSnapRef.current, minSnap: minSnapRef.current, - immediate: prefersReducedMotion.current, + immediate: + resizeSourceRef.current === 'element' + ? prefersReducedMotion.current + : true, }) }, [asyncSet, lastSnapRef, prefersReducedMotion]), closeSmoothly: useCallback(