From 837d3f5023d7f7e2d4fbbf6577ed1f8414d370dd Mon Sep 17 00:00:00 2001 From: Carlo Beltrame Date: Sat, 3 Feb 2024 22:49:31 +0100 Subject: [PATCH] Fix empty submit in activity title --- .../src/components/form/api/ApiWrapper.vue | 23 +++++++++++-------- 1 file changed, 13 insertions(+), 10 deletions(-) diff --git a/frontend/src/components/form/api/ApiWrapper.vue b/frontend/src/components/form/api/ApiWrapper.vue index f58f0e03db..030b99d3b0 100644 --- a/frontend/src/components/form/api/ApiWrapper.vue +++ b/frontend/src/components/form/api/ApiWrapper.vue @@ -140,17 +140,20 @@ export default { }, }, watch: { - apiValue: function (newValue) { - // override local value if it wasn't dirty - if (!this.dirty || this.overrideDirty) { - this.localValue = newValue - this.parsedLocalValue = this.parse ? this.parse(newValue) : newValue - } + apiValue: { + handler: function (newValue) { + // override local value if it wasn't dirty + if (!this.dirty || this.overrideDirty) { + this.localValue = newValue + this.parsedLocalValue = this.parse ? this.parse(newValue) : newValue + } - // clear dirty if outside value changes to same as local value (e.g. after save operation) - if (this.parsedLocalValue === newValue) { - this.dirty = false - } + // clear dirty if outside value changes to same as local value (e.g. after save operation) + if (this.parsedLocalValue === newValue) { + this.dirty = false + } + }, + immediate: true, }, }, created() {