Fix detail-view focus scope and entry targets

This commit is contained in:
2026-05-29 18:18:30 +00:00
parent 0b3cd15589
commit cac3348ec1
3 changed files with 123 additions and 23 deletions
+5 -3
View File
@@ -1,5 +1,5 @@
<template>
<div class="series-fullscreen">
<div ref="seriesRootRef" class="series-fullscreen">
<!-- Hero section with backdrop or season collage -->
<section class="series-hero">
<div class="hero-bg">
@@ -204,6 +204,8 @@ const emit = defineEmits<{
openFolder: [string, string | null | undefined]
}>()
const seriesRootRef = ref<HTMLElement | null>(null)
// Focus on matched episode when provided
watch(
() => props.focusEpisode,
@@ -222,9 +224,9 @@ watch(
if (episodeIndex >= 0) {
// Find the episode tile element using nav attributes
const selector = `[data-nav-row="${seasonIndex + 2}"][data-nav-col="${episodeIndex}"]`
const element = document.querySelector(selector) as HTMLElement | null
const element = seriesRootRef.value?.querySelector(selector) as HTMLElement | null
if (element) {
element.scrollIntoView({ behavior: "smooth", block: "center" })
element.scrollIntoView({ behavior: "smooth", block: "center", inline: "nearest" })
element.focus()
}
}