Skip to content

Commit 273d754

Browse files
author
hastom
committed
Moving observers to setTimeout
1 parent d8110e4 commit 273d754

File tree

1 file changed

+3
-6
lines changed

1 file changed

+3
-6
lines changed

src/components/MdMenu/MdMenuContent.vue

+3-6
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@
1717

1818
<script>
1919
import MdComponent from 'core/MdComponent'
20-
import MdPropValidator from 'core/utils/MdPropValidator'
2120
import MdObserveEvent from 'core/utils/MdObserveEvent'
2221
import MdResizeObserver from 'core/utils/MdResizeObserver'
2322
import MdPopover from 'components/MdPopover/MdPopover'
@@ -76,13 +75,12 @@
7675
shouldRender (shouldRender) {
7776
if (shouldRender) {
7877
this.setPopperSettings()
79-
80-
this.$nextTick().then(() => {
78+
setTimeout(() => {
8179
this.setInitialHighlightIndex()
8280
this.createClickEventObserver()
8381
this.createResizeObserver()
8482
this.createKeydownListener()
85-
})
83+
}, 0)
8684
}
8785
}
8886
},
@@ -207,8 +205,7 @@
207205
if (document) {
208206
this.MdMenu.bodyClickObserver = new MdObserveEvent(document.body, 'click', $event => {
209207
$event.stopPropagation()
210-
211-
if (!this.isMenuContentEl($event) && (this.MdMenu.closeOnClick || this.isBackdropExpectMenu($event))) {
208+
if (!this.isMenu($event) && (this.MdMenu.closeOnClick || !this.isMenuContentEl($event))) {
212209
this.MdMenu.active = false
213210
this.MdMenu.bodyClickObserver.destroy()
214211
this.MdMenu.windowResizeObserver.destroy()

0 commit comments

Comments
 (0)