Ensure removing a field from the update flow clears any row value. If not cleared, the field will remain in place.

This commit is contained in:
Dean 2024-06-28 16:23:00 +01:00
parent ec9ff57493
commit 37bfde9c93
1 changed files with 6 additions and 2 deletions

View File

@ -321,11 +321,15 @@
class:is-selected={Object.hasOwn(editableFields, field)} class:is-selected={Object.hasOwn(editableFields, field)}
on:click={() => { on:click={() => {
if (Object.hasOwn(editableFields, field)) { if (Object.hasOwn(editableFields, field)) {
editableFields[field] = null delete editableFields[field]
onChange({
meta: { fields: editableFields },
row: { [field]: null },
})
} else { } else {
editableFields[field] = {} editableFields[field] = {}
onChange({ meta: { fields: editableFields } })
} }
onChange({ meta: { fields: editableFields } })
}} }}
> >
<Icon <Icon