Compare commits

..

No commits in common. "site-fixes" and "main" have entirely different histories.

View file

@ -236,9 +236,9 @@ function withHiddenCleared(spec, row, parent?) {
// `detail`); a value is only hidden when none of them is showing. // `detail`); a value is only hidden when none of them is showing.
const shownPaths = new Set(spec.fields.filter((f) => fieldShown(f, row, parent)).map((f) => f.path)); const shownPaths = new Set(spec.fields.filter((f) => fieldShown(f, row, parent)).map((f) => f.path));
for (const field of spec.fields) { for (const field of spec.fields) {
const value = getPath(next, field.path); const value = next[field.path];
if (!shownPaths.has(field.path) && value != null && value !== "") { if (!shownPaths.has(field.path) && value != null && value !== "") {
next = setPath(next, field.path, ""); next = { ...next, [field.path]: "" };
} }
} }
for (const nested of spec.children ?? []) { for (const nested of spec.children ?? []) {
@ -853,12 +853,12 @@ export function Repeater({
field={field} field={field}
row={row} row={row}
parentRow={parentRow} parentRow={parentRow}
value={getPath(row, field.path)} value={row[field.path]}
// Its own lent options too: a map block's // Its own lent options too: a map block's
// Locations with a slide (095). // Locations with a slide (095).
options={spec.lends ? { ...options, ...spec.lends(row, options) } : options} options={spec.lends ? { ...options, ...spec.lends(row, options) } : options}
error={errors?.[`${errorPrefix}${index}.${field.path}`]} error={errors?.[`${errorPrefix}${index}.${field.path}`]}
onChange={(value) => update(index, setPath(row, field.path, value))} onChange={(value) => update(index, { ...row, [field.path]: value })}
onPatch={(patch) => update(index, { ...row, ...patch })} onPatch={(patch) => update(index, { ...row, ...patch })}
/> />
))} ))}