Co-authored-by: renee-png <262607627+renee-png@users.noreply.github.com>
This commit is contained in:
gpt-engineer-app[bot]
2026-04-26 08:39:08 +00:00
co-authored by renee-png
parent 5557baa643
commit bde7c5ef3c
+2
View File
@@ -63,6 +63,8 @@ export function SortableLedgerRow({ entry, onPatch, onRemove }: Props) {
const commit = (key: keyof EditableEntry, raw: string | number) => {
let val: any = raw;
if (NUM_COLS.some((c) => c.key === key)) val = raw === "" ? 0 : Number(raw) || 0;
// Allow blank dates / blank text fields
if (key === "entry_date" && raw === "") val = null;
if (val === (entry as any)[key]) return;
setDraft((d) => ({ ...d, [key]: val }));
onPatch(entry.id, { [key]: val } as any);