fix: admin/shared: adding a folder on Windows was displayed as a file #1243
Massimo Melina committed
Jun 14, 2026 at 16:16 UTC
9d976a871ed2ba7d31a15d9eb2b12975267fa523
1 file changed
+4
-4
admin/src/FilePicker.ts
+4
-4
@@ -115,6 +115,7 @@ export default function FilePicker({ onSelect, multiple=true, files=true, folder
115
children({ index, style }) {
116
const it = filteredList[index]
117
const isFolder = it.k === 'd'
118
+ const selectionId = it.n + (isFolder ? pathDelimiter : '')
119
// mui v9 requires MenuItem under MenuList, while these virtualized rows are plain list buttons
120
return h(ListItemButton, {
121
style: { ...style, padding: 0 },
@@ -127,12 +128,11 @@ export default function FilePicker({ onSelect, multiple=true, files=true, folder
128
}
129
},
130
multiple && h(Checkbox, {
130
- checked: sel.includes(it.n + (it.k ? '/' : '')),
131
+ checked: sel.includes(selectionId),
132
disabled: !folders && isFolder,
133
onClick(ev) {
133
- const id = it.n + (it.k ? '/' : '')
134
- const removed = sel.filter(x => x !== id)
135
- setSel(removed.length < sel.length ? removed : [...sel, id])
134
+ const removed = sel.filter(x => x !== selectionId)
135
+ setSel(removed.length < sel.length ? removed : [...sel, selectionId])
136
ev.stopPropagation()
137
},
138
}),