List category collapse fix (#2626)

Signed-off-by: Denis Bykhov <bykhov.denis@gmail.com>
This commit is contained in:
Denis Bykhov 2023-02-13 15:36:24 +06:00 committed by GitHub
parent 351e10817b
commit 32f1f80d5f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -122,47 +122,45 @@
const dispatch = createEventDispatcher()
</script>
{#each categories as category, i}
{#each categories as category, i (category)}
{@const items = groupedDocs[category] ?? []}
{#key category}
<ListCategory
{elementByIndex}
{indexById}
{extraHeaders}
{space}
{selectedObjectIds}
{headerComponent}
initIndex={getInitIndex(categories, i)}
{baseMenuClass}
{level}
{viewOptions}
{groupByKey}
{lookup}
{config}
{docByIndex}
{itemModels}
{_class}
singleCat={level === 0 && categories.length === 1}
{category}
{items}
{newObjectProps}
{createItemDialog}
{createItemLabel}
{loadingPropsLength}
on:check
on:uncheckAll
on:row-focus
on:dragstart={(e) => {
dispatch('dragstart', {
target: e.detail.target,
index: e.detail.index + getInitIndex(categories, i)
})
}}
{flatHeaders}
{disableHeader}
{props}
{listDiv}
bind:dragItem
/>
{/key}
<ListCategory
{elementByIndex}
{indexById}
{extraHeaders}
{space}
{selectedObjectIds}
{headerComponent}
initIndex={getInitIndex(categories, i)}
{baseMenuClass}
{level}
{viewOptions}
{groupByKey}
{lookup}
{config}
{docByIndex}
{itemModels}
{_class}
singleCat={level === 0 && categories.length === 1}
{category}
{items}
{newObjectProps}
{createItemDialog}
{createItemLabel}
{loadingPropsLength}
on:check
on:uncheckAll
on:row-focus
on:dragstart={(e) => {
dispatch('dragstart', {
target: e.detail.target,
index: e.detail.index + getInitIndex(categories, i)
})
}}
{flatHeaders}
{disableHeader}
{props}
{listDiv}
bind:dragItem
/>
{/each}