Skip to content

Commit

Permalink
Fix: Fixed overlay snap bug #171 (#172)
Browse files Browse the repository at this point in the history
* Fix: Fixed overlay snap bug #171

* Fix
  • Loading branch information
emirhangumus committed Dec 5, 2023
1 parent 3d23430 commit 349f66e
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/use-snap-points.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,11 @@ export function useSnapPoints({
);

const shouldFade =
(snapPoints && snapPoints.length > 0 && fadeFromIndex && snapPoints[fadeFromIndex] === activeSnapPoint) ||
(snapPoints &&
snapPoints.length > 0 &&
(fadeFromIndex || fadeFromIndex === 0) &&
!Number.isNaN(fadeFromIndex) &&
snapPoints[fadeFromIndex] === activeSnapPoint) ||
!snapPoints;

const activeSnapPointIndex = React.useMemo(
Expand Down

0 comments on commit 349f66e

Please sign in to comment.