fix: Prevent keyboard shortcuts in expression editor modal (#4984)

* fix: prevent keyboard shortcuts in expression editor modal

* support esc
This commit is contained in:
Mutasem Aldmour 2022-12-20 14:38:41 +01:00 committed by GitHub
parent c41c707654
commit 29364ea702
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 1 deletions

View file

@ -47,6 +47,7 @@
:value="value"
:isReadOnly="isReadOnly"
@change="valueChanged"
@close="closeDialog"
ref="inputFieldExpression"
data-test-id="expression-modal-input"
/>

View file

@ -1,5 +1,5 @@
<template>
<div ref="root" class="ph-no-capture"></div>
<div ref="root" class="ph-no-capture" @keydown.stop @keydown.esc="onClose"></div>
</template>
<script lang="ts">
@ -82,6 +82,9 @@ export default mixins(expressionManager, workflowHelpers).extend({
this.editor?.destroy();
},
methods: {
onClose() {
this.$emit('close');
},
itemSelected({ variable }: IVariableItemSelected) {
if (!this.editor || this.isReadOnly) return;