fix: admin/shared: crash after switching from a folder to another #1213
Massimo Melina committed
Apr 18, 2026 at 12:32 UTC
14c8446fd5458ed2de54eb284a5b107557af13ca
1 file changed
+3
-2
admin/src/VfsTree.ts
+3
-2
@@ -133,8 +133,9 @@ export default function VfsTree({ statusApi }:{ statusApi: ApiObject }) {
133
// be sure the selected element is visible
134
const treeId = 'vfs'
135
const first = selectedFiles[0]
136
- useEffect(() => document.getElementById(`${treeId}-${first?.id}`)?.scrollIntoView({ block: 'nearest', behavior: 'instant' as any }),
137
- [first])
136
+ useEffect(() => { // scrollIntoView in modern browsers is returning a Promise
137
+ document.getElementById(`${treeId}-${first?.id}`)?.scrollIntoView({ block: 'nearest', behavior: 'instant' })
138
+ }, [first])
139
return h(Flex, { flexDirection: 'column', alignItems: 'stretch', flex: 1 },
140
h(Flex, { mb: 1, flexWrap: 'wrap', gap: [1, 2] },
141
h(Typography, { variant: 'h6' }, "Virtual File System"),