v0.4.1 — Qty input fix
Bug fix
Qty field no longer resets on every digit typed in the invoice form.
Root causes fixed
watch()calls inInvoiceNew.tsxsubscribed the entire form component to re-render on every child field change, including each keystroke in the Qty input. Replaced withuseWatch()so only the four watched fields (currency,transport_mode,incoterm,show_sa_number) trigger a parent re-render.- The Qty
<Input>was a controlled input (value={String(qty)}) tied to the parsed float fromuseWatch. Intermediate values like"1."were immediately overwritten by the form store value. Replaced withregister(..., { valueAsNumber: true }), matching the existingunit_pricepattern — the browser now owns the display state.
Unchanged
- Total-amount computation (
useWatch+useEffectinGoodsRow) - Footer totals, Zod validation, submit payload shape
- All other invoice fields, backend logic, and PDF/Excel exports