From 5f1a2d0c92a2d65100eb12cc0a24f58132c1ff64 Mon Sep 17 00:00:00 2001 From: Lucas Werey Date: Wed, 8 Jul 2026 00:26:17 +0200 Subject: [PATCH] fix(mock): fire onDismiss/onClose callbacks in BottomSheetModal and BottomSheet MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit dismiss(), close(), and forceClose() in the mock silently drop their respective onDismiss/onClose props. Any component that relies on these callbacks for cleanup (e.g. queued drawer systems) silently hangs in tests — queue entries stay stuck in a 'dismissing' state and block subsequent sheets from opening. Fix: call this.props?.onDismiss?.() in dismiss(), and this.props?.onClose?.() in close()/forceClose() for both BottomSheetModal and BottomSheet. --- mock.js | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/mock.js b/mock.js index d75699682..d613bac03 100644 --- a/mock.js +++ b/mock.js @@ -34,9 +34,11 @@ class BottomSheetModal extends React.Component { collapse() {} close() { this.data = null; + this.props?.onClose?.(); } forceClose() { this.data = null; + this.props?.onClose?.(); } present(data) { // Store data passed to present @@ -46,6 +48,7 @@ class BottomSheetModal extends React.Component { } dismiss() { this.data = null; + this.props?.onDismiss?.(); } render() { @@ -61,8 +64,12 @@ class BottomSheet extends React.Component { snapToPosition() {} expand() {} collapse() {} - close() {} - forceClose() {} + close() { + this.props?.onClose?.(); + } + forceClose() { + this.props?.onClose?.(); + } render() { return this.props.children;