From cf628a8ea5f88b0718d5eb42b1a83b1b24c51a4e Mon Sep 17 00:00:00 2001 From: iozeey Date: Fri, 15 Dec 2023 18:33:53 +0500 Subject: [PATCH] fix reset values on deleting me fields --- app/javascript/template_builder/area.vue | 23 ++++++++++++++++------- 1 file changed, 16 insertions(+), 7 deletions(-) diff --git a/app/javascript/template_builder/area.vue b/app/javascript/template_builder/area.vue index 13fb6dc7..11a2b2ea 100644 --- a/app/javascript/template_builder/area.vue +++ b/app/javascript/template_builder/area.vue @@ -590,27 +590,36 @@ export default { this.save() }, removeField () { + const templateValue = this.template.values[this.field.uuid] switch (this.field.type) { case 'my_signature': - this.showMySignature = false - this.myLocalSignatureValue = '' + if (this.myLocalSignatureValue === templateValue) { + this.showMySignature = false + this.myLocalSignatureValue = '' + } console.log('switch signature portion') break case 'my_initials': - this.showMyInitials = false - this.myLocalInitialsValue = '' + if (this.myLocalInitialsValue === templateValue) { + this.showMyInitials = false + this.myLocalInitialsValue = '' + } console.log('switch initials portion') break case 'my_date': - this.showMyDate = false - this.myLocalDateValue = '' + if (this.myLocalDateValue === templateValue) { + this.showMyDate = false + this.myLocalDateValue = '' + } console.log('switch my_date portion') break case 'my_text': - this.myLocalText = '' + if (this.myLocalText === templateValue) { + this.myLocalText = '' + } break default: console.log('switch default portion')