Skip to content

Commit b3b7189

Browse files
committed
refactor: make Dialog.onClose required
1 parent dec534a commit b3b7189

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

packages/frontend/src/components/Dialog/Dialog.tsx

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,17 @@ import { runtime } from '@deltachat-desktop/runtime-interface'
88
const DEFAULT_WIDTH = 500
99

1010
type Props = React.PropsWithChildren<{
11-
onClose?: (result?: any) => void
11+
/**
12+
* This will be invoked when the dialog is closed e.g. with
13+
* outside click ({@linkcode canOutsideClickClose})
14+
* or {@linkcode canEscapeKeyClose}.
15+
*
16+
* You must respect this callback and unrender this component
17+
* when the callback is invoked, otherwise it can so happen
18+
* that this component is rendered, but the dialog is not acutally visible
19+
* (this has to do with `showModal`).
20+
*/
21+
onClose: ((result?: any) => void) | undefined
1222
canEscapeKeyClose?: boolean
1323
canOutsideClickClose?: boolean
1424
/** whether backdrop can be used to drag window around on tauri, used on onboarding screen and deletion screen */

0 commit comments

Comments
 (0)