diff --git a/packages/bbui/src/Modal/ModalContent.svelte b/packages/bbui/src/Modal/ModalContent.svelte
index 678a813a61..09cc4f6c52 100644
--- a/packages/bbui/src/Modal/ModalContent.svelte
+++ b/packages/bbui/src/Modal/ModalContent.svelte
@@ -14,6 +14,7 @@
export let showConfirmButton = true
export let showCloseIcon = true
export let onConfirm = undefined
+ export let onCancel = undefined
export let disabled = false
export let showDivider = true
@@ -28,6 +29,14 @@
}
loading = false
}
+
+ async function close() {
+ loading = true
+ if (!onCancel || (await onCancel()) !== false) {
+ cancel()
+ }
+ loading = false
+ }
{#if showCancelButton}
-
+
{/if}
{#if showConfirmButton}