fix scrollerref not setting properly

This commit is contained in:
Henry Jameson 2022-09-28 21:23:27 +03:00
parent 8c4de692f4
commit 1c459028cc

View file

@ -119,13 +119,15 @@ const Notifications = {
}, },
teleportTarget () { teleportTarget () {
// handle scroller change // handle scroller change
this.scrollerRef.removeEventListener('scroll', this.updateScrollPosition) this.$nextTick(() => {
this.scrollerRef = this.$refs.root.closest('.column.-scrollable') this.scrollerRef.removeEventListener('scroll', this.updateScrollPosition)
if (!this.scrollerRef) { this.scrollerRef = this.$refs.root.closest('.column.-scrollable')
this.scrollerRef = this.$refs.root.closest('.mobile-notifications') if (!this.scrollerRef) {
} this.scrollerRef = this.$refs.root.closest('.mobile-notifications')
this.scrollerRef.addEventListener('scroll', this.updateScrollPosition) }
this.updateScrollPosition() this.scrollerRef.addEventListener('scroll', this.updateScrollPosition)
this.updateScrollPosition()
})
} }
}, },
methods: { methods: {