File tree 2 files changed +5
-4
lines changed
2 files changed +5
-4
lines changed Original file line number Diff line number Diff line change 57
57
dense: this .mdDense ,
58
58
closeOnSelect: this .mdCloseOnSelect ,
59
59
bodyClickObserver: null ,
60
- windowResizeObserver: null
60
+ windowResizeObserver: null ,
61
+ $el: this .$el
61
62
}
62
63
}
63
64
},
105
106
},
106
107
methods: {
107
108
toggleContent ($event ) {
108
- $event .stopPropagation ()
109
109
this .MdMenu .active = ! this .MdMenu .active
110
110
}
111
111
},
112
112
async mounted () {
113
+ this .MdMenu .$el = this .$el
113
114
await this .$nextTick ()
114
115
115
116
this .triggerEl = this .$el .querySelector (' [md-menu-trigger]' )
Original file line number Diff line number Diff line change 187
187
if (document ) {
188
188
this .MdMenu .bodyClickObserver = new MdObserveEvent (document .body , ' click' , $event => {
189
189
$event .stopPropagation ()
190
-
191
- if (! this .$el .contains ($event .target )) {
190
+ let isMdMenu = this . MdMenu . $el ? this . MdMenu . $el . contains ( $event . target ) : false
191
+ if (! this .$el .contains ($event .target ) && ! isMdMenu ) {
192
192
this .MdMenu .active = false
193
193
this .MdMenu .bodyClickObserver .destroy ()
194
194
this .MdMenu .windowResizeObserver .destroy ()
You can’t perform that action at this time.
0 commit comments