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" :value="value"
:isReadOnly="isReadOnly" :isReadOnly="isReadOnly"
@change="valueChanged" @change="valueChanged"
@close="closeDialog"
ref="inputFieldExpression" ref="inputFieldExpression"
data-test-id="expression-modal-input" data-test-id="expression-modal-input"
/> />

View file

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