Preserve sidebar scroll position when navigating between documents
- Add x-navigate:scroll directive to sidebar container to maintain scroll position - Add x-navigate:scroll to all document links in sidebar (tree-item.blade.php) - Add x-navigate:scroll to 'New Document' button - When clicking a link in sidebar, the sidebar scroll position is now preserved during page navigation - Fixes issue where sidebar would scroll to top after loading a document
This commit is contained in:
@@ -200,6 +200,7 @@ class="absolute right-0 mt-2 w-48 bg-white rounded-md shadow-lg py-1 ring-1 ring
|
||||
<div class="flex h-[calc(100vh-4rem)]">
|
||||
<!-- Sidebar - Desktop -->
|
||||
<aside
|
||||
x-navigate:scroll
|
||||
class="hidden lg:block bg-white border-r border-gray-200 overflow-y-auto relative"
|
||||
:style="'width: ' + sidebarWidth + 'px'"
|
||||
>
|
||||
|
||||
Reference in New Issue
Block a user