From 05649bb5d627d3c854a66e1df5a4e6f147e70700 Mon Sep 17 00:00:00 2001 From: kmsheng Date: Wed, 27 May 2020 16:24:38 +0800 Subject: [PATCH] fix undefined dom.contains in IE11 (#2090) --- src/components/MdMenu/MdMenuContent.vue | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/components/MdMenu/MdMenuContent.vue b/src/components/MdMenu/MdMenuContent.vue index b8d0de99d..7ff07c489 100644 --- a/src/components/MdMenu/MdMenuContent.vue +++ b/src/components/MdMenu/MdMenuContent.vue @@ -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) {