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:
2025-12-04 01:37:19 +09:00
parent b96012f598
commit e66ece71e3
3 changed files with 3 additions and 0 deletions

View File

@@ -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'"
>