aboutsummaryrefslogtreecommitdiff
path: root/src/components/notifications
diff options
context:
space:
mode:
authorHenry Jameson <me@hjkos.com>2022-09-28 21:23:27 +0300
committerHenry Jameson <me@hjkos.com>2022-09-28 21:23:27 +0300
commit1c459028cc8670e1644c314279097fe20d0d9341 (patch)
tree11f098b2731de57244e7e1b27882edf8f90d404b /src/components/notifications
parent8c4de692f462552a7416540392df0f2a260fe817 (diff)
fix scrollerref not setting properly
Diffstat (limited to 'src/components/notifications')
-rw-r--r--src/components/notifications/notifications.js16
1 files changed, 9 insertions, 7 deletions
diff --git a/src/components/notifications/notifications.js b/src/components/notifications/notifications.js
index 2682912a..c3acd9e0 100644
--- a/src/components/notifications/notifications.js
+++ b/src/components/notifications/notifications.js
@@ -119,13 +119,15 @@ const Notifications = {
},
teleportTarget () {
// handle scroller change
- this.scrollerRef.removeEventListener('scroll', this.updateScrollPosition)
- this.scrollerRef = this.$refs.root.closest('.column.-scrollable')
- if (!this.scrollerRef) {
- this.scrollerRef = this.$refs.root.closest('.mobile-notifications')
- }
- this.scrollerRef.addEventListener('scroll', this.updateScrollPosition)
- this.updateScrollPosition()
+ this.$nextTick(() => {
+ this.scrollerRef.removeEventListener('scroll', this.updateScrollPosition)
+ this.scrollerRef = this.$refs.root.closest('.column.-scrollable')
+ if (!this.scrollerRef) {
+ this.scrollerRef = this.$refs.root.closest('.mobile-notifications')
+ }
+ this.scrollerRef.addEventListener('scroll', this.updateScrollPosition)
+ this.updateScrollPosition()
+ })
}
},
methods: {