Skip to content

Commit

Permalink
fix: stabilise modal un-mounting (#254)
Browse files Browse the repository at this point in the history
  • Loading branch information
gorhom committed Feb 1, 2021
1 parent d11a889 commit 43efd16
Showing 1 changed file with 8 additions and 7 deletions.
15 changes: 8 additions & 7 deletions src/components/bottomSheetModal/BottomSheetModal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -76,18 +76,19 @@ const BottomSheetModalComponent = forwardRef<

//#region callbacks
const doDismiss = useCallback(() => {
if (_providedOnDismiss) {
_providedOnDismiss();
}
// reset
isMinimized.current = false;
isForcedDismissed.current = false;

// unmount the sheet and the portal
unmountSheet(key);
unmountPortal(key);

setMount(false);

// reset
isMinimized.current = false;
isForcedDismissed.current = false;
// fire the call back
if (_providedOnDismiss) {
_providedOnDismiss();
}
}, [key, _providedOnDismiss, unmountSheet, unmountPortal]);
const handleOnChange = useCallback(
(_index: number) => {
Expand Down

0 comments on commit 43efd16

Please sign in to comment.