You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Sep 28, 2024. It is now read-only.
I think that support for a custom cancellation confirmation in the wizard is something necessary. Imagine you have a 5+ pages wizard and you filled all the information, but on the last page, you misclick the cancel button and you lose all the data you inputted. You would wish you were asked if you were sure.
Proposed solution
Add a isCanceled property and a onCancel() function:
/** * Specifies whether the wizard can be safely closed*/var isCanceled =true/** * This function is called when the cancel button is pressed, but before closing the wizard.*/openfunonCancel() {
isCanceled =true
}
The onCancel() function would be called before closing the wizard. Then the wizard will only be closed if isCanceled is true (Wizard.kt#L164-L167)
Good suggestion, thanks. I've implemented it slightly different. When the cancel button is clicked, the onCancel function is called. The default implementation calls cancel(), which closes the wizard. In the future the cancel function might do more things to clean up on cancel.
You would now override onCancel like this:
overridefunonCancel() {
confirm("Confirm cancel", "Do you really want to loose your progress?") {
cancel()
}
}
Problem
I think that support for a custom cancellation confirmation in the wizard is something necessary. Imagine you have a 5+ pages wizard and you filled all the information, but on the last page, you misclick the cancel button and you lose all the data you inputted. You would wish you were asked if you were sure.
Proposed solution
Add a
isCanceled
property and aonCancel()
function:The
onCancel()
function would be called before closing the wizard. Then the wizard will only be closed ifisCanceled
istrue
(Wizard.kt#L164-L167)Example
Compatibility
This change should not break any existing code because by default the wizard is closed on pressing the cancel button as always.
The text was updated successfully, but these errors were encountered: