Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

N8N-3265 When leaving parameter details view via pressing 'esc', value is still updated #3098

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 8 additions & 1 deletion packages/editor-ui/src/components/TextEdit.vue
Original file line number Diff line number Diff line change
Expand Up @@ -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>
Expand Down Expand Up @@ -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.
Expand Down