From 5df1701ae7fc5377e4e8b9ec8853e376245c15c8 Mon Sep 17 00:00:00 2001 From: artoscinote <85488244+artoscinote@users.noreply.github.com> Date: Wed, 10 Aug 2022 15:34:17 +0200 Subject: [PATCH] Improve cancel edit button reliability, fix blink for non-smart-annotation fields [SCI-7068] (#4344) --- app/javascript/vue/shared/inline_edit.vue | 20 +++++++++----------- 1 file changed, 9 insertions(+), 11 deletions(-) diff --git a/app/javascript/vue/shared/inline_edit.vue b/app/javascript/vue/shared/inline_edit.vue index 12eb4a610..81a2c19cc 100644 --- a/app/javascript/vue/shared/inline_edit.vue +++ b/app/javascript/vue/shared/inline_edit.vue @@ -13,7 +13,7 @@ @blur="handleBlur" @keyup.escape="cancelEdit" > -
+
{{ error }}
@@ -22,7 +22,7 @@
-
+
@@ -182,15 +182,13 @@ return; } - setTimeout(() => { - if(this.error) return; - if(!this.$refs.input) return; - this.newValue = this.$refs.input.value // Fix for smart annotation - this.newValue = this.newValue.trim(); - this.editing = false; - this.$emit('editingDisabled'); - this.$emit('update', this.newValue); - }, 100) // due to clicking 'x' also triggering a blur event + if(this.error) return; + if(!this.$refs.input) return; + this.newValue = this.$refs.input.value // Fix for smart annotation + this.newValue = this.newValue.trim(); + this.editing = false; + this.$emit('editingDisabled'); + this.$emit('update', this.newValue); } } }