Skip to content

Commit 413b30d

Browse files
committed
fix: Listen on internal sheet closing for SheetDialog
1 parent 8401fd1 commit 413b30d

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/components/SheetDialog.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,12 +31,15 @@ export function SheetDialog(sheetRegistry: SheetsStackComponent, title: Refable<
3131
sheetRegistry.remove(sheet);
3232
});
3333

34+
sheet.setOnClose(() => {
35+
isOpen.setValue(false);
36+
});
3437

3538
return {
3639
open: () => isOpen.setValue(true),
3740
close: () => isOpen.setValue(false),
3841
setId: (id: string) => sheet.setId(id),
39-
setOnClose: (onClose: () => void) => sheet.setOnClose(onClose),
42+
setOnClose: (onClose: () => void) => isOpen.listen(onClose),
4043
setCanClose: (pointer: Reference<boolean>) => sheet.setCanClose(pointer),
4144
};
4245
}

0 commit comments

Comments
 (0)