File tree Expand file tree Collapse file tree 1 file changed +16
-3
lines changed Expand file tree Collapse file tree 1 file changed +16
-3
lines changed Original file line number Diff line number Diff line change 3
3
name =" dialog-fade"
4
4
@after-enter =" afterEnter"
5
5
@after-leave =" afterLeave" >
6
- <div class =" el-dialog__wrapper" v-show =" visible" @click.self =" handleWrapperClick" >
6
+ <div class =" el-dialog__wrapper" v-show =" visible" @click.self =" handleWrapperClick" @mouseup = " handleMouseup " >
7
7
<div
8
8
role =" dialog"
9
9
aria-modal =" true"
10
10
:aria-label =" title || 'dialog'"
11
11
class =" el-dialog"
12
12
:class =" [{ 'is-fullscreen': fullscreen, 'el-dialog--center': center }, customClass]"
13
13
ref =" dialog"
14
- :style =" style" >
14
+ :style =" style"
15
+ @mousedown =" handleMousedown" >
15
16
<div class =" el-dialog__header" >
16
17
<slot name =" title" >
17
18
<span class =" el-dialog__title" >{{ title }}</span >
39
40
import Migrating from ' element-ui/src/mixins/migrating' ;
40
41
import emitter from ' element-ui/src/mixins/emitter' ;
41
42
43
+ let dialogMouseDown = false ;
44
+
42
45
export default {
43
46
name: ' ElDialog' ,
44
47
152
155
};
153
156
},
154
157
handleWrapperClick () {
155
- if (! this .closeOnClickModal ) return ;
158
+ if (! this .closeOnClickModal || dialogMouseDown ) return ;
156
159
this .handleClose ();
157
160
},
161
+ handleMousedown () {
162
+ dialogMouseDown = true ;
163
+ },
164
+ handleMouseup () {
165
+ if (dialogMouseDown) {
166
+ this .$nextTick (_ => {
167
+ dialogMouseDown = false ;
168
+ });
169
+ }
170
+ },
158
171
handleClose () {
159
172
if (typeof this .beforeClose === ' function' ) {
160
173
this .beforeClose (this .hide );
You can’t perform that action at this time.
0 commit comments