From 4b2010091caa5171db42ab92d4f028ac08a3a383 Mon Sep 17 00:00:00 2001 From: Alex Grozav Date: Wed, 6 Apr 2022 14:06:11 +0300 Subject: [PATCH] :bug: Resetting text-edit input value when pressing esc key to have matching input values. --- packages/editor-ui/src/components/TextEdit.vue | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/packages/editor-ui/src/components/TextEdit.vue b/packages/editor-ui/src/components/TextEdit.vue index 6a4de8a450932..7ee367556d53a 100644 --- a/packages/editor-ui/src/components/TextEdit.vue +++ b/packages/editor-ui/src/components/TextEdit.vue @@ -4,7 +4,7 @@
-
+
@@ -35,6 +35,13 @@ export default Vue.extend({ this.$emit('valueChanged', value); }, + onKeyDownEsc () { + // Resetting input value when closing the dialog, required when closing it using the `Esc` key + this.tempValue = this.value; + + this.closeDialog(); + }, + closeDialog () { // Handle the close externally as the visible parameter is an external prop // and is so not allowed to be changed here.