Fix/preceding zeros in input fields#9
Conversation
|
@lucy-04 is attempting to deploy a commit to the Ateeb Ur Rehman's projects Team on Vercel. A member of the Team first needs to authorize it. |
📝 WalkthroughWalkthroughNumeric input handling now supports empty intermediate values during editing and restores minimum quantities on blur across delivery challans, inventory adjustments, invoices, quotations, and the shared ChangesNumeric input editing
Estimated code review effort: 3 (Moderate) | ~20 minutes Possibly related issues
Suggested reviewers: 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@src/modules/inventory/InventoryModule.tsx`:
- Around line 235-239: Buffer numeric input text before converting it to numbers
so intermediate values are preserved. In
src/modules/inventory/InventoryModule.tsx lines 235-239, preserve “-” until a
valid negative adjustment is entered; in
src/modules/deliveryChallan/CreateDeliveryChallanModule.tsx lines 445-448,
preserve fractional quantities such as 0.5; and in
src/modules/invoices/CreateInvoiceModule.tsx lines 510-523, preserve
zero-prefixed decimal quantities and unit prices. Use the shared buffered Input
component where feasible, or maintain local string drafts and normalize values
on blur.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro Plus
Run ID: c149380f-146f-42de-83a7-a39fdbdd7c07
📒 Files selected for processing (5)
src/components/ui/Input.tsxsrc/modules/deliveryChallan/CreateDeliveryChallanModule.tsxsrc/modules/inventory/InventoryModule.tsxsrc/modules/invoices/CreateInvoiceModule.tsxsrc/modules/quotations/CreateQuotationModule.tsx
fix: buffer numeric Input text while typing to prevent leading zeros
fix: allow item quantity/price fields to be cleared during editing
Summary by CodeRabbit