Skip to content

Commit 92794c5

Browse files
committed
fix undefined dom.contains in IE11
1 parent ff6d041 commit 92794c5

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

src/components/MdMenu/MdMenuContent.vue

+7-1
Original file line numberDiff line numberDiff line change
@@ -201,7 +201,13 @@
201201
return this.$refs.menu ? this.$refs.menu.contains(target) : false
202202
},
203203
isBackdropExpectMenu ($event) {
204-
return !this.$el.contains($event.target) && !this.isMenu($event)
204+
const contains = (el, target) => {
205+
if ('contains' in el) {
206+
return el.contains(target)
207+
}
208+
return el.compareDocumentPosition(target) & 16
209+
}
210+
return !contains(this.$el, $event.target) && !this.isMenu($event)
205211
},
206212
createClickEventObserver () {
207213
if (document) {

0 commit comments

Comments
 (0)