Skip to content

Commit

Permalink
fix: fixed sheet visibility when handle provided null (#224)
Browse files Browse the repository at this point in the history
  • Loading branch information
gorhom authored Jan 21, 2021
1 parent cbfe80a commit c32e700
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions src/components/bottomSheet/BottomSheet.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -124,8 +124,9 @@ const BottomSheetComponent = forwardRef<BottomSheet, BottomSheetProps>(
// safe layout values

const safeHandleHeight = useMemo(
() => handleHeight || DEFAULT_HANDLE_HEIGHT,
[handleHeight]
() =>
handleComponent === null ? 0 : handleHeight || DEFAULT_HANDLE_HEIGHT,
[handleHeight, handleComponent]
);
const safeContainerHeight = useMemo(
() => _providedContainerHeight || containerHeight || WINDOW_HEIGHT,
Expand All @@ -139,7 +140,9 @@ const BottomSheetComponent = forwardRef<BottomSheet, BottomSheetProps>(
);
const shouldMeasureHandleHeight = useMemo(
() =>
_providedHandleHeight === undefined && handleComponent !== undefined,
_providedHandleHeight === undefined &&
handleComponent !== undefined &&
handleComponent !== null,
[_providedHandleHeight, handleComponent]
);

Expand Down

0 comments on commit c32e700

Please sign in to comment.