Skip to content

Commit b9ecabb

Browse files
authored
Dialog: Revert Fix close bug (#15000) (#15544) (#16201)
This reverts commit 5626627.
1 parent 5626627 commit b9ecabb

File tree

1 file changed

+3
-16
lines changed

1 file changed

+3
-16
lines changed

packages/dialog/src/component.vue

Lines changed: 3 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -3,16 +3,15 @@
33
name="dialog-fade"
44
@after-enter="afterEnter"
55
@after-leave="afterLeave">
6-
<div class="el-dialog__wrapper" v-show="visible" @click.self="handleWrapperClick" @mouseup="handleMouseup">
6+
<div class="el-dialog__wrapper" v-show="visible" @click.self="handleWrapperClick">
77
<div
88
role="dialog"
99
aria-modal="true"
1010
:aria-label="title || 'dialog'"
1111
class="el-dialog"
1212
:class="[{ 'is-fullscreen': fullscreen, 'el-dialog--center': center }, customClass]"
1313
ref="dialog"
14-
:style="style"
15-
@mousedown="handleMousedown">
14+
:style="style">
1615
<div class="el-dialog__header">
1716
<slot name="title">
1817
<span class="el-dialog__title">{{ title }}</span>
@@ -40,8 +39,6 @@
4039
import Migrating from 'element-ui/src/mixins/migrating';
4140
import emitter from 'element-ui/src/mixins/emitter';
4241
43-
let dialogMouseDown = false;
44-
4542
export default {
4643
name: 'ElDialog',
4744
@@ -155,19 +152,9 @@
155152
};
156153
},
157154
handleWrapperClick() {
158-
if (!this.closeOnClickModal || dialogMouseDown) return;
155+
if (!this.closeOnClickModal) return;
159156
this.handleClose();
160157
},
161-
handleMousedown() {
162-
dialogMouseDown = true;
163-
},
164-
handleMouseup() {
165-
if (dialogMouseDown) {
166-
this.$nextTick(_ => {
167-
dialogMouseDown = false;
168-
});
169-
}
170-
},
171158
handleClose() {
172159
if (typeof this.beforeClose === 'function') {
173160
this.beforeClose(this.hide);

0 commit comments

Comments
 (0)