Fix sidebar scroll preservation per page with x-navigate directive
- Add x-navigate directive to all sidebar document links for Alpine navigation - Store scroll position per page using URL path as key in sessionStorage - Each page now maintains its own scroll position in the sidebar - Save scroll position before navigation and restore after navigation - Scroll position is preserved when clicking links in the sidebar - Works correctly with Alpine navigate events triggered by x-navigate directive
This commit is contained in:
@@ -18,6 +18,7 @@
|
||||
@auth
|
||||
<div class="mt-6 pt-6 border-t border-gray-200">
|
||||
<a
|
||||
x-navigate
|
||||
href="{{ route('documents.create') }}"
|
||||
class="flex items-center justify-center px-4 py-2 text-sm font-medium text-white bg-indigo-600 rounded-md hover:bg-indigo-700"
|
||||
>
|
||||
|
||||
Reference in New Issue
Block a user