Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 8 additions & 5 deletions src/components/bottomSheetModal/BottomSheetModal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -273,13 +273,16 @@ function BottomSheetModalComponent<T = never>(
}

/**
* if the modal position is already in a closed position,
* then we unmount the node and early exit.
* if the modal has no inner sheet to animate (never presented,
* already closed, or minimized), then we unmount the node and
* early exit.
*/
if (
[MODAL_STATUS.CLOSED, MODAL_STATUS.MINIMIZED].includes(
statusRef.current
) ||
[
MODAL_STATUS.INITIAL,
MODAL_STATUS.CLOSED,
MODAL_STATUS.MINIMIZED,
].includes(statusRef.current) ||
(statusRef.current === MODAL_STATUS.DISMISSING &&
currentIndexRef.current === -1)
) {
Expand Down