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')