Skip to content

v0.4.2 — Qty input fix (production)

Choose a tag to compare

@janayuv janayuv released this 21 May 05:03
· 69 commits to master since this release

Bug fix

Qty field no longer resets on every digit in the installed app (production build).

v0.4.1 fixed the issue in dev mode but not in the production binary. The real root cause was @base-ui/react/input (the InputPrimitive used by every Input component) resetting its display value whenever its parent re-renders — even without a controlled value= prop. This does not surface in Vite dev mode but is reproducible in the compiled Tauri binary.

What changed in v0.4.2

GoodsRow previously held three useWatch subscriptions (qty, price, currentTotal) that caused it to re-render on every keystroke, re-rendering its inputs and triggering the Base UI reset.

  • Removed all three subscriptions and the useEffect that computed the total
  • Total is now computed inside register's onChange option (fires after RHF's store update, so getValues already holds the new value)
  • Row amount display extracted into a standalone RowTotal child component — only RowTotal re-renders when total_amount changes; GoodsRow and its inputs are never touched during typing

Unchanged

  • Footer totals, Zod validation, submit payload, PDF/Excel exports
  • All other invoice fields and backend logic