mirror of
https://github.com/n8n-io/n8n.git
synced 2024-12-24 20:24:05 -08:00
fix(ui): Reset text-edit input value when pressing esc key to have matching input values (#3098)
This commit is contained in:
parent
176538e5f2
commit
29fdd77d7b
|
@ -4,7 +4,7 @@
|
|||
|
||||
<div class="ignore-key-press">
|
||||
<n8n-input-label :label="$locale.nodeText().inputLabelDisplayName(parameter, path)">
|
||||
<div @keydown.stop @keydown.esc="closeDialog()">
|
||||
<div @keydown.stop @keydown.esc="onKeyDownEsc()">
|
||||
<n8n-input v-model="tempValue" type="textarea" ref="inputField" :value="value" :placeholder="$locale.nodeText().placeholder(parameter, path)" @change="valueChanged" @keydown.stop="noOp" :rows="15" />
|
||||
</div>
|
||||
</n8n-input-label>
|
||||
|
@ -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.
|
||||
|
|
Loading…
Reference in a new issue