fix(databases): render array column items with their element type

The string fallback in the row column renderer exists for the spreadsheet
inline cell editor, where an entire array is edited as one comma-separated
textarea. It keyed off `column.array` (the column definition) rather than
the `array` prop (the render mode).

In the full row create/edit form, columnItem renders one Column per array
element and deliberately omits the `array` prop so each item gets its
element-type input. Since `column.array` was still true, every item
collapsed to a string input -- a Boolean[] column showed "Enter string".

This also caused intermittent save failures: the string component still ran
parseValue() against column.type, so literal true/false/1/0 coerced and
saved, while anything else yielded null, and a null inside a typed array is
rejected by the API.

Keying off the `array` prop restores per-item typed inputs (boolean select,
number input with min/max, date picker) while leaving the spreadsheet cell
editor and its "Advanced edit" link untouched, since only the two
fromSpreadsheet branches pass `array`.
This commit is contained in:
harsh mahajan committed 2026-08-07 10:49:32 +05:30
1 parent 6aa937295c
commit 9f0ae45537
1 file changed
+1 -1
@@ -88,7 +88,7 @@
{:else}
<!-- the `on:click` is from string > array mode for advanced edit button -->
<svelte:component
this={column.array || (isSpatialType(column) && limited)
this={array || (isSpatialType(column) && limited)
? columnsTypeMap['string']
: columnsTypeMap[column.type]}
{id}