Skip to content

Commit 349f66e

Browse files
authored
Fix: Fixed overlay snap bug #171 (#172)
* Fix: Fixed overlay snap bug #171 * Fix
1 parent 3d23430 commit 349f66e

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/use-snap-points.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,11 @@ export function useSnapPoints({
3232
);
3333

3434
const shouldFade =
35-
(snapPoints && snapPoints.length > 0 && fadeFromIndex && snapPoints[fadeFromIndex] === activeSnapPoint) ||
35+
(snapPoints &&
36+
snapPoints.length > 0 &&
37+
(fadeFromIndex || fadeFromIndex === 0) &&
38+
!Number.isNaN(fadeFromIndex) &&
39+
snapPoints[fadeFromIndex] === activeSnapPoint) ||
3640
!snapPoints;
3741

3842
const activeSnapPointIndex = React.useMemo(

0 commit comments

Comments
 (0)