Skip to content

Commit 0fb8dda

Browse files
committed
fix dialog with input closing after typing #183
1 parent 6ee5ea4 commit 0fb8dda

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

src/components/mdDialog/mdDialog.vue

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<template>
2-
<div class="md-dialog-container" :class="classes" @keyup.esc="mdEscToClose && close()" tabindex="0">
2+
<div class="md-dialog-container" :class="classes" @keyup.esc.stop="closeOnEsc" tabindex="0">
33
<div class="md-dialog" ref="dialog" :style="styles" :class="dialogClasses">
44
<slot></slot>
55
</div>
@@ -101,6 +101,11 @@
101101
102102
this.$emit('open');
103103
},
104+
closeOnEsc() {
105+
if (this.mdEscToClose) {
106+
this.close();
107+
}
108+
},
104109
close() {
105110
if (this.rootElement.contains(this.dialogElement)) {
106111
this.$nextTick(() => {

0 commit comments

Comments
 (0)