From fefd5fa0dcbd81d60e4f9b68d4acb8d3a723a400 Mon Sep 17 00:00:00 2001 From: mike12345567 Date: Mon, 16 Oct 2023 17:41:20 +0100 Subject: [PATCH] Quick fix for drag and drop behaviour of relationship cells, appears empty cells were causing things to break in the re-render. --- .../grid/cells/RelationshipCell.svelte | 50 ++++++++++--------- 1 file changed, 26 insertions(+), 24 deletions(-) diff --git a/packages/frontend-core/src/components/grid/cells/RelationshipCell.svelte b/packages/frontend-core/src/components/grid/cells/RelationshipCell.svelte index 925c840478..e6d83e0bea 100644 --- a/packages/frontend-core/src/components/grid/cells/RelationshipCell.svelte +++ b/packages/frontend-core/src/components/grid/cells/RelationshipCell.svelte @@ -260,29 +260,31 @@ class:wrap={editable || contentLines > 1} on:wheel={e => (focused ? e.stopPropagation() : null)} > - {#each value || [] as relationship} - {#if relationship[primaryDisplay] || relationship.primaryDisplay} -
- showRelationship(relationship._id) - : null} - > - {readable( - relationship[primaryDisplay] || relationship.primaryDisplay - )} - - {#if editable} - toggleRow(relationship)} - /> - {/if} -
- {/if} - {/each} + {#if Array.isArray(value) && value.length} + {#each value as relationship} + {#if relationship[primaryDisplay] || relationship.primaryDisplay} +
+ showRelationship(relationship._id) + : null} + > + {readable( + relationship[primaryDisplay] || relationship.primaryDisplay + )} + + {#if editable} + toggleRow(relationship)} + /> + {/if} +
+ {/if} + {/each} + {/if} {#if editable}
@@ -318,7 +320,7 @@
- {:else if searchResults?.length} + {:else if Array.isArray(searchResults) && searchResults.length}
{#each searchResults as row, idx}