mirror of
https://github.com/Hopiu/vue-material.git
synced 2026-05-03 21:14:44 +00:00
fix dialog with input closing after typing #183
This commit is contained in:
parent
6ee5ea4b64
commit
0fb8ddaf7d
1 changed files with 6 additions and 1 deletions
|
|
@ -1,5 +1,5 @@
|
|||
<template>
|
||||
<div class="md-dialog-container" :class="classes" @keyup.esc="mdEscToClose && close()" tabindex="0">
|
||||
<div class="md-dialog-container" :class="classes" @keyup.esc.stop="closeOnEsc" tabindex="0">
|
||||
<div class="md-dialog" ref="dialog" :style="styles" :class="dialogClasses">
|
||||
<slot></slot>
|
||||
</div>
|
||||
|
|
@ -101,6 +101,11 @@
|
|||
|
||||
this.$emit('open');
|
||||
},
|
||||
closeOnEsc() {
|
||||
if (this.mdEscToClose) {
|
||||
this.close();
|
||||
}
|
||||
},
|
||||
close() {
|
||||
if (this.rootElement.contains(this.dialogElement)) {
|
||||
this.$nextTick(() => {
|
||||
|
|
|
|||
Loading…
Reference in a new issue