Quick fix for drag and drop behaviour of relationship cells, appears empty cells were causing things to break in the re-render.

This commit is contained in:
mike12345567 2023-10-16 17:41:20 +01:00
parent 64f4701b57
commit fefd5fa0dc
1 changed files with 26 additions and 24 deletions

View File

@ -260,29 +260,31 @@
class:wrap={editable || contentLines > 1} class:wrap={editable || contentLines > 1}
on:wheel={e => (focused ? e.stopPropagation() : null)} on:wheel={e => (focused ? e.stopPropagation() : null)}
> >
{#each value || [] as relationship} {#if Array.isArray(value) && value.length}
{#if relationship[primaryDisplay] || relationship.primaryDisplay} {#each value as relationship}
<div class="badge"> {#if relationship[primaryDisplay] || relationship.primaryDisplay}
<span <div class="badge">
on:click={editable <span
? () => showRelationship(relationship._id) on:click={editable
: null} ? () => showRelationship(relationship._id)
> : null}
{readable( >
relationship[primaryDisplay] || relationship.primaryDisplay {readable(
)} relationship[primaryDisplay] || relationship.primaryDisplay
</span> )}
{#if editable} </span>
<Icon {#if editable}
name="Close" <Icon
size="XS" name="Close"
hoverable size="XS"
on:click={() => toggleRow(relationship)} hoverable
/> on:click={() => toggleRow(relationship)}
{/if} />
</div> {/if}
{/if} </div>
{/each} {/if}
{/each}
{/if}
{#if editable} {#if editable}
<div class="add" on:click={open}> <div class="add" on:click={open}>
<Icon name="Add" size="S" /> <Icon name="Add" size="S" />
@ -318,7 +320,7 @@
<div class="searching"> <div class="searching">
<ProgressCircle size="S" /> <ProgressCircle size="S" />
</div> </div>
{:else if searchResults?.length} {:else if Array.isArray(searchResults) && searchResults.length}
<div class="results"> <div class="results">
{#each searchResults as row, idx} {#each searchResults as row, idx}
<div <div