Skip to content
Snippets Groups Projects
Commit a0e1eadf authored by permcu's avatar permcu
Browse files

Make DialogObjectForm clear fields after successful creation

This makes using the form more then once a much better experience.
parent 333c2c23
No related branches found
No related tags found
1 merge request!1299Resolve "DialogObjectForm does not clear fields on successful creation"
Pipeline #138885 failed
......@@ -226,13 +226,17 @@ export default {
messageKey: snackbarTextKey,
color: "success",
});
this.resetModel();
},
resetModel() {
this.itemModel = JSON.parse(
JSON.stringify(this.isCreate ? this.defaultItem : this.editItem)
);
},
updateModel() {
// Only update the model if the dialog is hidden or has just been mounted
if (this.forceModelItemUpdate || !this.firstInitDone || !this.dialog) {
this.itemModel = JSON.parse(
JSON.stringify(this.isCreate ? this.defaultItem : this.editItem)
);
this.resetModel();
}
},
},
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment