Implement synced category row scrolling.

This commit is contained in:
2026-05-16 23:00:54 +00:00
parent 81fbfee5d3
commit 5bb46c162e
4 changed files with 219 additions and 11 deletions
+2 -3
View File
@@ -193,7 +193,7 @@ import MediaRow from './components/MediaRow.vue';
import MediaDetail from './components/MediaDetail.vue';
// Initialize keyboard navigation
const { getFocusState, restoreFocusState, focusAt } = useKeyboardNavigation();
const { getFocusState, restoreFocusState, focusAt, focusElement } = useKeyboardNavigation();
const router = useRouter();
const route = useRoute();
@@ -315,8 +315,7 @@ function restoreFocusForPage(page: string) {
// Find the element with matching item id
const element = document.querySelector(`[data-item-id="${itemId}"]`) as HTMLElement | null;
if (element) {
element.focus();
element.scrollIntoView({ behavior: 'smooth', block: 'nearest', inline: 'nearest' });
focusElement(element);
lastViewedItemId.value = null;
return;
}