Skip to content

Commit

Permalink
feat: add destroyOnClose for Dialog (#1391)
Browse files Browse the repository at this point in the history
  • Loading branch information
jikkai committed Feb 20, 2024
1 parent 71fc6b0 commit a6e17ef
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion packages/design/src/components/dialog/Dialog.tsx
Expand Up @@ -59,6 +59,12 @@ export interface IDialogProps {
*/
closeIcon?: React.ReactNode;

/**
* Whether the dialog should be destroyed on close.
* @default false
*/
destroyOnClose?: boolean;

/**
* The footer of the dialog.
*/
Expand All @@ -79,6 +85,7 @@ export function Dialog(props: IDialogProps) {
width,
draggable = false,
closeIcon = <CloseSingle />,
destroyOnClose = false,
footer,
onClose,
} = props;
Expand Down Expand Up @@ -124,10 +131,11 @@ export function Dialog(props: IDialogProps) {
title={TitleIfDraggable}
modalRender={modalRender}
closeIcon={closeIcon}
destroyOnClose={destroyOnClose}
footer={footer}
onClose={onClose}
mask={!draggable}
style={style}
onClose={onClose}
>
{children}
</RcDialog>
Expand Down

0 comments on commit a6e17ef

Please sign in to comment.