commit: e3b9c00d5e1bfadc0e1e1bcd06c43cf53035f0c0
parent 832d7f2354b2f70e4100ac343c6ac4dd985eac3a
Author: Henry Jameson <me@hjkos.com>
Date: Wed, 8 Jun 2022 03:22:15 +0300
hide popovers on scroll
Diffstat:
1 file changed, 5 insertions(+), 0 deletions(-)
diff --git 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()
}
}