From 1c459028cc8670e1644c314279097fe20d0d9341 Mon Sep 17 00:00:00 2001 From: Henry Jameson Date: Wed, 28 Sep 2022 21:23:27 +0300 Subject: [PATCH] fix scrollerref not setting properly --- src/components/notifications/notifications.js | 16 +++++++++------- 1 file 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: {