diff --git a/.audit-screenshots/fix-08-new-quote-empty-qty.png b/.audit-screenshots/fix-08-new-quote-empty-qty.png new file mode 100644 index 0000000..977cde1 Binary files /dev/null and b/.audit-screenshots/fix-08-new-quote-empty-qty.png differ diff --git a/src/components/quote-form-item-card.tsx b/src/components/quote-form-item-card.tsx index 463d583..4043d49 100644 --- a/src/components/quote-form-item-card.tsx +++ b/src/components/quote-form-item-card.tsx @@ -10,7 +10,12 @@ import { Textarea } from "@/components/ui/textarea"; export interface DraftQuoteItem { id: string; description: string; - quantity: number; + /** + * Line-item count the operator typed. Starts empty so the operator + * can type e.g. "22" without having to delete a default "1" first. + * Falls back to 1 on submit when left blank — see quote-form.tsx. + */ + quantity: number | ""; notes: string; files: File[]; /** @@ -62,7 +67,15 @@ export function QuoteFormItemCard({ item, onChange, onRemove }: QuoteFormItemCar type="number" min={1} value={item.quantity} - onChange={(e) => onChange({ quantity: Math.max(1, Number(e.target.value) || 1) })} + onChange={(e) => { + const raw = e.target.value; + // Empty input = "not entered yet". Submit falls back to 1. + if (raw === "") { + onChange({ quantity: "" }); + } else { + onChange({ quantity: Math.max(1, Number(raw) || 1) }); + } + }} />