From 40e1c419c60d984849061b4a7ad4260d3dc0f90e Mon Sep 17 00:00:00 2001 From: Jason Yu Date: Tue, 12 May 2026 20:29:10 +0100 Subject: [PATCH 1/2] fix: make dismiss() idempotent on a never-presented modal (#2669) Co-Authored-By: Claude Opus 4.7 (1M context) --- src/components/bottomSheetModal/BottomSheetModal.tsx | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/components/bottomSheetModal/BottomSheetModal.tsx b/src/components/bottomSheetModal/BottomSheetModal.tsx index 2954b3f4..7399ab50 100644 --- a/src/components/bottomSheetModal/BottomSheetModal.tsx +++ b/src/components/bottomSheetModal/BottomSheetModal.tsx @@ -277,9 +277,11 @@ function BottomSheetModalComponent( * 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) ) { From 272b495235fbe51b5eff04a1b2db69355d48f4df Mon Sep 17 00:00:00 2001 From: Jason Yu Date: Tue, 12 May 2026 20:35:41 +0100 Subject: [PATCH 2/2] docs: clarify handleDismiss early-exit comment Co-Authored-By: Claude Opus 4.7 (1M context) --- src/components/bottomSheetModal/BottomSheetModal.tsx | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/components/bottomSheetModal/BottomSheetModal.tsx b/src/components/bottomSheetModal/BottomSheetModal.tsx index 7399ab50..98eb90fa 100644 --- a/src/components/bottomSheetModal/BottomSheetModal.tsx +++ b/src/components/bottomSheetModal/BottomSheetModal.tsx @@ -273,8 +273,9 @@ function BottomSheetModalComponent( } /** - * 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 ( [