Fix sidebar scroll position preservation during page navigation

- Replace unstable x-navigate:scroll directive with custom Alpine event handlers
- Use alpine:navigating event to save sidebar scroll position to localStorage
- Use alpine:navigated event to restore sidebar scroll position after navigation
- Sidebar now maintains scroll position when clicking document links
- Fixed 'Element not found' error that was preventing scroll restoration
- Uses requestAnimationFrame for smooth DOM restoration
This commit is contained in:
2025-12-04 01:47:51 +09:00
parent e66ece71e3
commit 8dba510a6c
3 changed files with 28 additions and 3 deletions

View File

@@ -18,7 +18,6 @@
@auth
<div class="mt-6 pt-6 border-t border-gray-200">
<a
x-navigate:scroll
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"
>