Fix notification scrolling

This commit is contained in:
Chocobozzz 2023-11-07 11:19:17 +01:00
parent 624da0b0a4
commit 6e613df63f
No known key found for this signature in database
GPG Key ID: 583A612D890159BE
1 changed files with 4 additions and 4 deletions

View File

@ -66,20 +66,20 @@ export class NotificationComponent implements OnInit, OnDestroy {
onPopoverShown () { onPopoverShown () {
this.opened = true this.opened = true
document.querySelector('menu').scrollTo(0, 0) // Reset menu scroll to easy lock document.querySelector('nav').scrollTo(0, 0) // Reset menu scroll to easy lock
document.querySelector('menu').addEventListener('scroll', this.onMenuScrollEvent) document.querySelector('nav').addEventListener('scroll', this.onMenuScrollEvent)
} }
onPopoverHidden () { onPopoverHidden () {
this.loaded = false this.loaded = false
this.opened = false this.opened = false
document.querySelector('menu').removeEventListener('scroll', this.onMenuScrollEvent) document.querySelector('nav').removeEventListener('scroll', this.onMenuScrollEvent)
} }
// Lock menu scroll when menu scroll to avoid fleeing / detached dropdown // Lock menu scroll when menu scroll to avoid fleeing / detached dropdown
onMenuScrollEvent () { onMenuScrollEvent () {
document.querySelector('menu').scrollTo(0, 0) document.querySelector('nav').scrollTo(0, 0)
} }
onNotificationLoaded () { onNotificationLoaded () {