From 0de67278fccfb22e874f29158e4760405f794d0e Mon Sep 17 00:00:00 2001 From: Julien Nahum Date: Mon, 27 Mar 2023 16:22:24 +0200 Subject: [PATCH] Reflect AI changes on form fields editor --- .../open/forms/components/FormFieldsEditor.vue | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/resources/js/components/open/forms/components/FormFieldsEditor.vue b/resources/js/components/open/forms/components/FormFieldsEditor.vue index 98d1fbd..82e5317 100644 --- a/resources/js/components/open/forms/components/FormFieldsEditor.vue +++ b/resources/js/components/open/forms/components/FormFieldsEditor.vue @@ -209,7 +209,19 @@ export default { handler() { this.$set(this.form, 'properties', this.formFields) } + }, + + 'form.properties':{ + deep: true, + handler() { + // If different, then update + if (this.form.properties.length !== this.formFields.length || + JSON.stringify(this.form.properties) !== JSON.stringify(this.formFields)) { + this.formFields = clonedeep(this.form.properties) + } + } } + }, mounted() {