Skip to content

Commit

Permalink
fix: only animate on RESIZE if the source = element
Browse files Browse the repository at this point in the history
  • Loading branch information
stipsan committed Jan 21, 2021
1 parent 383e206 commit ceb3671
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/BottomSheet.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down

0 comments on commit ceb3671

Please sign in to comment.