Skip to content

armgit / vaul

Public Imported from GitHub
0

A drawer component for React.

Fix controlled snap poinst (#248)

Emil Kowalski0ae910804b4f
diff --git a/src/index.tsx b/src/index.tsx
index b880d47..fca1d1d 100644
--- a/src/index.tsx
+++ b/src/index.tsx
@@ -260,6 +260,7 @@ function Root({
? `translate3d(0, ${translateValue}px, 0)`
: `translate3d(${translateValue}px, 0, 0)`,
});
+
return;
}
diff --git a/src/use-snap-points.ts b/src/use-snap-points.ts
index 214eb06..6fe8e26 100644
--- a/src/use-snap-points.ts
+++ b/src/use-snap-points.ts
@@ -43,7 +43,7 @@ export function useSnapPoints({
!snapPoints;
const activeSnapPointIndex = React.useMemo(
- () => snapPoints?.findIndex((snapPoint) => snapPoint === activeSnapPoint) || null,
+ () => snapPoints?.findIndex((snapPoint) => snapPoint === activeSnapPoint),
[snapPoints, activeSnapPoint],
);