We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 58da597 commit 30a4dceCopy full SHA for 30a4dce
app/components/Code/FileTree.vue
@@ -36,12 +36,20 @@ function getFileRoute(nodePath: string): RouteLocationRaw {
36
37
const { toggleDir, isExpanded, autoExpandAncestors } = useFileTreeState(props.baseUrl)
38
39
+const scrollIntoView = () => {
40
+ const el = document.querySelector('[aria-current="true"]') as HTMLElement
41
+ if (el) {
42
+ el.scrollIntoView({ block: 'center' })
43
+ }
44
+}
45
+
46
// Auto-expand directories in the current path
47
watch(
48
() => props.currentPath,
49
path => {
50
if (path) {
51
autoExpandAncestors(path)
52
+ nextTick(scrollIntoView)
53
}
54
},
55
{ immediate: true },
0 commit comments