Skip to content

Commit

Permalink
test: use full path as itemId
Browse files Browse the repository at this point in the history
  • Loading branch information
ArmanNik committed Nov 27, 2024
1 parent cbe8fb5 commit dde849a
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions v2/pink-sb/src/lib/DirectoryPicker/DirectoryItem.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@
</script>

{#each directories as { title, fileCount, fullPath, thumbnailUrl, children }, i}
{@const itemId = `${title}-${i}`}
{@const hasChildren = !!children?.length}
{@const thumb = thumbnailUrl}

Expand All @@ -50,7 +49,7 @@
dispatch('select', { title, fullPath, hasChildren });
}}
use:melt={$item({
id: itemId,
id: fullPath,
hasChildren
})}
>
Expand All @@ -64,7 +63,7 @@
/>
<div
class="chevron-container"
class:folder-open={$isExpanded(itemId)}
class:folder-open={$isExpanded(fullPath)}
class:disabled={!hasChildren}
>
<IconChevronRight />
Expand Down Expand Up @@ -102,7 +101,7 @@
</button>

{#if children}
<div use:melt={$group({ id: itemId })}>
<div use:melt={$group({ id: fullPath })}>
<svelte:self directories={children} level={level + 1} {containerWidth} on:select />
</div>
{/if}
Expand Down

0 comments on commit dde849a

Please sign in to comment.