Skip to content

Commit

Permalink
fix undefined dom.contains in IE11 (#2090)
Browse files Browse the repository at this point in the history
  • Loading branch information
kmsheng authored May 27, 2020
1 parent 6ab3b1e commit 05649bb
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/components/MdMenu/MdMenuContent.vue
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,13 @@
return this.$refs.menu ? this.$refs.menu.contains(target) : false
},
isBackdropExpectMenu ($event) {
return !this.$el.contains($event.target) && !this.isMenu($event)
const contains = (el, target) => {
if ('contains' in el) {
return el.contains(target)
}
return el.compareDocumentPosition(target) & 16
}
return !contains(this.$el, $event.target) && !this.isMenu($event)
},
createClickEventObserver () {
if (document) {
Expand Down

0 comments on commit 05649bb

Please sign in to comment.