admin/fs: scroll tree but keep toolbar
Massimo Melina committed
Oct 31, 2024 at 11:36 UTC
c25212e302e049956ec4d7a6676f729de8410096
1 file changed
+2
-1
admin/src/VfsTree.ts
+2
-1
@@ -119,7 +119,7 @@ export default function VfsTree({ id2node, statusApi }:{ id2node: Map<string, Vf
119
const first = selectedFiles[0]
120
useEffect(() => document.getElementById(`${treeId}-${first?.id}`)?.scrollIntoView({ block: 'center', behavior: 'instant' as any }),
121
[first])
122
- return h(Flex, { flexDirection: 'column', alignItems: 'stretch' },
122
+ return h(Flex, { flexDirection: 'column', alignItems: 'stretch', flex: 1 },
123
h(Flex, { mb: 1, flexWrap: 'wrap', gap: [0, 2] },
124
h(Typography, { variant: 'h6' }, "Virtual File System"),
125
h(VfsMenuBar, { statusApi, add: toggleBtn }),
@@ -132,6 +132,7 @@ export default function VfsTree({ id2node, statusApi }:{ id2node: Map<string, Vf
132
multiSelect: true,
133
id: treeId,
134
sx: {
135
+ height: 0, flex: '1 1 auto',
136
overflowX: 'auto',
137
maxWidth: ref.current && `calc(100vw - ${16 + ref.current.offsetLeft}px)`, // limit possible horizontal scrolling to this element
138
'& ul': { borderLeft: '1px dashed #444', marginLeft: '15px', paddingLeft: '15px' },