From e9b7abfd63d3a5b12bae4d3061bd8a0f03241b52 Mon Sep 17 00:00:00 2001 From: davelopez <46503462+davelopez@users.noreply.github.com> Date: Wed, 13 Nov 2024 13:18:39 +0100 Subject: [PATCH] Revert "Reduce buildFormData calls" This reverts commit 34c06de59404dce1c187487daa773cb07ae89b61. We cannot use this.onChange here because on initial load there would be no change in the formData and the onChange event would not be triggered. --- client/src/components/Form/FormDisplay.vue | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/client/src/components/Form/FormDisplay.vue b/client/src/components/Form/FormDisplay.vue index 94029923c1b6..e51dfe7e39b1 100644 --- a/client/src/components/Form/FormDisplay.vue +++ b/client/src/components/Form/FormDisplay.vue @@ -139,7 +139,10 @@ export default { }, created() { this.onCloneInputs(); - this.onChange(); + // build flat formData that is ready to be submitted + this.formData = this.buildFormData(); + // emit back to parent, so that parent has submittable data + this.$emit("onChange", this.formData); // highlight initial warnings this.onWarnings(); // highlight initial errors