Fix issue with deleting rows and fix relationship cells displaying undefined
This commit is contained in:
parent
9020060f17
commit
856f0eb844
|
@ -6,9 +6,11 @@
|
||||||
|
|
||||||
<div class="container">
|
<div class="container">
|
||||||
{#each value || [] as relationship, idx}
|
{#each value || [] as relationship, idx}
|
||||||
<div class="badge" style="--color: {getColor(idx)}">
|
{#if relationship.primaryDisplay}
|
||||||
{relationship.primaryDisplay}
|
<div class="badge" style="--color: {getColor(idx)}">
|
||||||
</div>
|
{relationship.primaryDisplay}
|
||||||
|
</div>
|
||||||
|
{/if}
|
||||||
{/each}
|
{/each}
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
|
@ -140,7 +140,7 @@ export const createRowsStore = context => {
|
||||||
|
|
||||||
// Process as either an update, addition or deletion
|
// Process as either an update, addition or deletion
|
||||||
if (newRow) {
|
if (newRow) {
|
||||||
if (index !== -1) {
|
if (index != null) {
|
||||||
// An existing row was updated
|
// An existing row was updated
|
||||||
rows.update(state => {
|
rows.update(state => {
|
||||||
state[index] = { ...newRow }
|
state[index] = { ...newRow }
|
||||||
|
@ -150,7 +150,7 @@ export const createRowsStore = context => {
|
||||||
// A new row was created
|
// A new row was created
|
||||||
handleNewRows([newRow])
|
handleNewRows([newRow])
|
||||||
}
|
}
|
||||||
} else if (index !== -1) {
|
} else if (index != null) {
|
||||||
// A row was removed
|
// A row was removed
|
||||||
handleRemoveRows([$rows[index]])
|
handleRemoveRows([$rows[index]])
|
||||||
}
|
}
|
||||||
|
@ -171,7 +171,7 @@ export const createRowsStore = context => {
|
||||||
const $rowLookupMap = get(rowLookupMap)
|
const $rowLookupMap = get(rowLookupMap)
|
||||||
const index = $rowLookupMap[rowId]
|
const index = $rowLookupMap[rowId]
|
||||||
const row = $rows[index]
|
const row = $rows[index]
|
||||||
if (index === -1 || row?.[column] === value) {
|
if (index == null || row?.[column] === value) {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue