Skip to content

Commit

Permalink
fix: handle initial closed sheet
Browse files Browse the repository at this point in the history
  • Loading branch information
gorhom committed May 26, 2021
1 parent 2599f6c commit 4bc40d9
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/components/bottomSheet/BottomSheet.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -912,7 +912,12 @@ const BottomSheetComponent = forwardRef<BottomSheet, BottomSheetProps>(
return;
}

const nextPosition = animatedSnapPoints.value[_providedIndex];
let nextPosition;
if (_providedIndex === -1) {
nextPosition = animatedContainerHeight.value;
} else {
nextPosition = animatedSnapPoints.value[_providedIndex];
}

/**
* here we exit method early because the next position
Expand Down
1 change: 1 addition & 0 deletions src/components/bottomSheetScrollable/types.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import type {
ScrollViewProps,
FlatListProps,
SectionListProps,
SectionListScrollParams,
} from 'react-native';
import type Animated from 'react-native-reanimated';

Expand Down

0 comments on commit 4bc40d9

Please sign in to comment.