diff --git a/resources/views/components/navbar.blade.php b/resources/views/components/navbar.blade.php index fbb5291fb..feb555b75 100644 --- a/resources/views/components/navbar.blade.php +++ b/resources/views/components/navbar.blade.php @@ -44,8 +44,15 @@ this.theme = 'system'; document.documentElement.classList.remove('dark'); } - } -}"> + }, + saveScrollPosition() { + localStorage.setItem('navbarScrollPosition', this.$refs.navbar.scrollTop); + }, + restoreScrollPosition() { + this.$nextTick(() => { + this.$refs.navbar.scrollTop = localStorage.getItem('navbarScrollPosition') || 0; + }); + }}" @livewire:load="restoreScrollPosition()" @livewire:update="saveScrollPosition()">