Skip to content

Commit b6b972a

Browse files
committed
fix: initial snap points when it is 100% (#105)
1 parent 6840a47 commit b6b972a

File tree

2 files changed

+2
-11
lines changed

2 files changed

+2
-11
lines changed

src/components/bottomSheet/useTransition.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ export const useTransition = ({
6565
const clock = useClock();
6666
const config = useMemo(
6767
() => ({
68-
toValue: new Animated.Value(0),
68+
toValue: new Animated.Value(-1),
6969
duration: animationDuration,
7070
easing: animationEasing,
7171
}),

src/hooks/useNormalizedSnapPoints.ts

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -8,21 +8,12 @@ export const useNormalizedSnapPoints = (
88
handleHeight: number = 0
99
) =>
1010
useMemo(() => {
11-
let normalizedSnapPoints = normalizeSnapPoints(
11+
const normalizedSnapPoints = normalizeSnapPoints(
1212
snapPoints,
1313
containerHeight,
1414
topInset
1515
);
1616
return normalizedSnapPoints.map(normalizedSnapPoint => {
17-
/**
18-
* if user sets point to zero and `excludeHandleHeight` true,
19-
* we subset handleHeight from the `normalizedSnapPoint` to make
20-
* sure that sheets and its handle will be out of the screen.
21-
*/
22-
if (normalizedSnapPoint === 0 && handleHeight !== 0) {
23-
normalizedSnapPoint = normalizedSnapPoint - handleHeight;
24-
}
25-
2617
return Math.ceil(
2718
Math.max(containerHeight - normalizedSnapPoint - handleHeight, topInset)
2819
);

0 commit comments

Comments
 (0)