diff --git a/en/application-dev/reference/arkui-ts/ts-methods-custom-dialog-box.md b/en/application-dev/reference/arkui-ts/ts-methods-custom-dialog-box.md index 37bf4de513a5773e660b53d8a07c621882c21714..2aef524442b5684e2a509565e642033f50f6cd06 100644 --- a/en/application-dev/reference/arkui-ts/ts-methods-custom-dialog-box.md +++ b/en/application-dev/reference/arkui-ts/ts-methods-custom-dialog-box.md @@ -108,6 +108,11 @@ struct CustomDialogUser { customStyle: false }) + aboutToDisappear() { + delete this.dialogController, + this.dialogController = undefined + } + onCancel() { console.info('Callback when the first button is clicked') } @@ -124,7 +129,9 @@ struct CustomDialogUser { Column() { Button(this.inputValue) .onClick(() => { - this.dialogController.open() + if (this.dialogController != undefined) { + this.dialogController.open() + } }).backgroundColor(0x317aff) }.width('100%').margin({ top: 5 }) }