diff --git a/dist/file-picker.esm.js b/dist/file-picker.esm.js index a4e0f78..d9f7ac1 100644 --- a/dist/file-picker.esm.js +++ b/dist/file-picker.esm.js @@ -501,7 +501,7 @@ function safeEntryParts(entryName) { return parts; } function node(kind, name, path, children = [], file = null) { - return { id: crypto.randomUUID(), kind, name, path, children, file, expanded: true }; + return { id: crypto.randomUUID(), kind, name, path, children, file, expanded: kind === "file" }; } function addPath(root, parts, fileNode) { let current = root; @@ -745,7 +745,7 @@ function onFolderChange(state, cfg, elements) { name: rootName, path: rootName, children: [], - expanded: true + expanded: false }); } const root = roots.get(rootName); @@ -762,7 +762,7 @@ function onFolderChange(state, cfg, elements) { name: part, path: `${rootName}/${nodeParts.slice(0, index + 1).join("/")}`, children: [], - expanded: true + expanded: false }; current.children.push(child); } diff --git a/dist/file-picker.iife.js b/dist/file-picker.iife.js index ca25259..0659d05 100644 --- a/dist/file-picker.iife.js +++ b/dist/file-picker.iife.js @@ -529,7 +529,7 @@ var FilePicker = (() => { return parts; } function node(kind, name, path, children = [], file = null) { - return { id: crypto.randomUUID(), kind, name, path, children, file, expanded: true }; + return { id: crypto.randomUUID(), kind, name, path, children, file, expanded: kind === "file" }; } function addPath(root, parts, fileNode) { let current = root; @@ -773,7 +773,7 @@ var FilePicker = (() => { name: rootName, path: rootName, children: [], - expanded: true + expanded: false }); } const root = roots.get(rootName); @@ -790,7 +790,7 @@ var FilePicker = (() => { name: part, path: `${rootName}/${nodeParts.slice(0, index + 1).join("/")}`, children: [], - expanded: true + expanded: false }; current.children.push(child); }