aboutsummaryrefslogtreecommitdiff
path: root/src/components/popover/popover.js
diff options
context:
space:
mode:
Diffstat (limited to 'src/components/popover/popover.js')
-rw-r--r--src/components/popover/popover.js5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/components/popover/popover.js b/src/components/popover/popover.js
index c65689bd..09e07b4c 100644
--- a/src/components/popover/popover.js
+++ b/src/components/popover/popover.js
@@ -168,6 +168,9 @@ const Popover = {
if (this.hidden) return
if (this.$el.contains(e.target)) return
this.hidePopover()
+ },
+ onScroll () {
+ this.hidePopover()
}
},
updated () {
@@ -183,9 +186,11 @@ const Popover = {
},
created () {
document.addEventListener('click', this.onClickOutside)
+ window.addEventListener('scroll', this.onScroll)
},
unmounted () {
document.removeEventListener('click', this.onClickOutside)
+ window.removeEventListener('scroll', this.onScroll)
this.hidePopover()
}
}