hide popovers on scroll
This commit is contained in:
parent
832d7f2354
commit
e3b9c00d5e
|
@ -168,6 +168,9 @@ const Popover = {
|
||||||
if (this.hidden) return
|
if (this.hidden) return
|
||||||
if (this.$el.contains(e.target)) return
|
if (this.$el.contains(e.target)) return
|
||||||
this.hidePopover()
|
this.hidePopover()
|
||||||
|
},
|
||||||
|
onScroll () {
|
||||||
|
this.hidePopover()
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
updated () {
|
updated () {
|
||||||
|
@ -183,9 +186,11 @@ const Popover = {
|
||||||
},
|
},
|
||||||
created () {
|
created () {
|
||||||
document.addEventListener('click', this.onClickOutside)
|
document.addEventListener('click', this.onClickOutside)
|
||||||
|
window.addEventListener('scroll', this.onScroll)
|
||||||
},
|
},
|
||||||
unmounted () {
|
unmounted () {
|
||||||
document.removeEventListener('click', this.onClickOutside)
|
document.removeEventListener('click', this.onClickOutside)
|
||||||
|
window.removeEventListener('scroll', this.onScroll)
|
||||||
this.hidePopover()
|
this.hidePopover()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue