We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent a45b0f1 commit 8ccd8bdCopy full SHA for 8ccd8bd
1 file changed
src/lib/file-explorer/FilePane.svelte
@@ -1,5 +1,5 @@
1
<script lang="ts">
2
- import { onMount, untrack } from 'svelte'
+ import { onMount, tick, untrack } from 'svelte'
3
import type { FileEntry } from './types'
4
import { openFile } from '$lib/tauri-commands'
5
import FileList from './FileList.svelte'
@@ -111,6 +111,12 @@
111
const visibleFiles = filterFiles(firstChunk, showHiddenFiles)
112
const targetIndex = visibleFiles.findIndex((f) => f.name === selectName)
113
selectedIndex = targetIndex >= 0 ? targetIndex : 0
114
+
115
+ // Scroll the selected folder into view (after DOM updates)
116
+ void tick().then(() => {
117
+ // eslint-disable-next-line @typescript-eslint/no-unsafe-call
118
+ fileListRef?.scrollToIndex(selectedIndex)
119
+ })
120
} else {
121
selectedIndex = 0
122
}
0 commit comments