changed | changed | Whether to show the dialog when the form is changed | boolean | true |
discardText | discard-text | The text to show on the discard button | string | 'Discard' |
form | form | ID of the form to submit the button to. Only use if the button is located outside the form. | string | undefined |
goBackText | go-back-text | The text to show on the go back button | string | 'Go Back' |
header | header | The header to show in the dialog | string | 'Discard draft?' |
message | message | The message to show in the dialog | string | "Any changes you made won't be saved. Are you sure you want to continue?" |
showDialogFn | show-dialog-fn | If you need to do custom logic to decide whether or not the dialog should show, pass a function here that returns true if you want it to display and false otherwise | () => boolean | Promise<boolean> | undefined |
touched | touched | Whether to show the dialog when the form is touched | boolean | true |