fix: admin/shared: wrong scrolling of the tree when an item is selected
Massimo Melina committed
Sep 28, 2025 at 19:40 UTC
01f68219f1fa74c76b4364c8c816f409ecf53837
1 file changed
+1
-1
admin/src/VfsTree.ts
+1
-1
@@ -127,7 +127,7 @@ export default function VfsTree({ id2node, statusApi }:{ id2node: Map<string, Vf
127
// be sure the selected element is visible
128
const treeId = 'vfs'
129
const first = selectedFiles[0]
130
- useEffect(() => document.getElementById(`${treeId}-${first?.id}`)?.scrollIntoView({ block: 'center', behavior: 'instant' as any }),
130
+ useEffect(() => document.getElementById(`${treeId}-${first?.id}`)?.scrollIntoView({ block: 'nearest', behavior: 'instant' as any }),
131
[first])
132
return h(Flex, { flexDirection: 'column', alignItems: 'stretch', flex: 1 },
133
h(Flex, { mb: 1, flexWrap: 'wrap', gap: [1, 2] },