Skip to content

Commit

Permalink
fix: initial snap points when it is 100% (#105)
Browse files Browse the repository at this point in the history
  • Loading branch information
gorhom committed Dec 13, 2020
1 parent 6840a47 commit b6b972a
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 11 deletions.
2 changes: 1 addition & 1 deletion src/components/bottomSheet/useTransition.ts
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ export const useTransition = ({
const clock = useClock();
const config = useMemo(
() => ({
toValue: new Animated.Value(0),
toValue: new Animated.Value(-1),
duration: animationDuration,
easing: animationEasing,
}),
Expand Down
11 changes: 1 addition & 10 deletions src/hooks/useNormalizedSnapPoints.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,21 +8,12 @@ export const useNormalizedSnapPoints = (
handleHeight: number = 0
) =>
useMemo(() => {
let normalizedSnapPoints = normalizeSnapPoints(
const normalizedSnapPoints = normalizeSnapPoints(
snapPoints,
containerHeight,
topInset
);
return normalizedSnapPoints.map(normalizedSnapPoint => {
/**
* if user sets point to zero and `excludeHandleHeight` true,
* we subset handleHeight from the `normalizedSnapPoint` to make
* sure that sheets and its handle will be out of the screen.
*/
if (normalizedSnapPoint === 0 && handleHeight !== 0) {
normalizedSnapPoint = normalizedSnapPoint - handleHeight;
}

return Math.ceil(
Math.max(containerHeight - normalizedSnapPoint - handleHeight, topInset)
);
Expand Down

0 comments on commit b6b972a

Please sign in to comment.