diff --git a/app/javascript/template_builder/builder.vue b/app/javascript/template_builder/builder.vue
index dd3ffd39..2ebcc1e8 100644
--- a/app/javascript/template_builder/builder.vue
+++ b/app/javascript/template_builder/builder.vue
@@ -217,14 +217,22 @@
{{ t('draw_field_on_the_document').replace('{field}', drawField.name) }}
-
+
@@ -577,10 +585,21 @@ export default {
ref.$el.scrollIntoView({ behavior: 'smooth', block: 'start' })
},
+ clearDrawField () {
+ if (this.drawField && !this.drawOption && this.drawField.areas.length === 0) {
+ const fieldIndex = this.template.fields.indexOf(this.drawField)
+
+ if (fieldIndex !== -1) {
+ this.template.fields.splice(fieldIndex, 1)
+ }
+ }
+ this.drawField = null
+ this.drawOption = null
+ },
onKeyUp (e) {
if (e.code === 'Escape') {
- this.drawField = null
- this.drawOption = null
+ this.clearDrawField()
+
this.selectedAreaRef.value = null
}
diff --git a/app/javascript/template_builder/fields.vue b/app/javascript/template_builder/fields.vue
index d7e26a0c..79f911a5 100644
--- a/app/javascript/template_builder/fields.vue
+++ b/app/javascript/template_builder/fields.vue
@@ -131,7 +131,7 @@
Drag & drop any other field type on the page
- Click on the field type above to add it to the form without drawing it on the document
+ Click on the field type above to start drawing it
@@ -295,7 +295,7 @@ export default {
this.fields.push(field)
- if (['signature', 'initials', 'cells', 'stamp'].includes(type)) {
+ if (!['payment', 'file'].includes(type)) {
this.$emit('set-draw', { field })
}
diff --git a/app/javascript/template_builder/i18n.js b/app/javascript/template_builder/i18n.js
index 81b4d9df..29b5d35e 100644
--- a/app/javascript/template_builder/i18n.js
+++ b/app/javascript/template_builder/i18n.js
@@ -30,6 +30,7 @@ const en = {
ninth_party: 'Ninth Party',
tenth_party: 'Tenth Party',
add: 'Add',
+ or_add_field_without_drawing: 'Or add field without drawing',
text: 'Text',
signature: 'Signature',
initials: 'Initials',