Skip to content

Fix/preceding zeros in input fields#9

Merged
AteebNoOne merged 2 commits into
iTeebot:mainfrom
lucy-04:fix/Preceding-zeros-in-input-fields
Jul 16, 2026
Merged

Fix/preceding zeros in input fields#9
AteebNoOne merged 2 commits into
iTeebot:mainfrom
lucy-04:fix/Preceding-zeros-in-input-fields

Conversation

@lucy-04

@lucy-04 lucy-04 commented Jul 16, 2026

Copy link
Copy Markdown
Contributor

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

  • Improvements
    • Numeric quantity, price, and stock fields can now be temporarily cleared while editing.
    • Quantity fields automatically restore a minimum value of 1 when leaving the field.
    • Updated item-entry forms provide more consistent numeric input behavior across delivery challans, invoices, quotations, and inventory adjustments.

@vercel

vercel Bot commented Jul 16, 2026

Copy link
Copy Markdown

@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.

@coderabbitai

coderabbitai Bot commented Jul 16, 2026

Copy link
Copy Markdown

Review Change Stack

📝 Walkthrough

Walkthrough

Numeric 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 Input component.

Changes

Numeric input editing

Layer / File(s) Summary
Shared numeric input behavior
src/components/ui/Input.tsx
Numeric inputs buffer raw text, derive their displayed value, forward events through handlers, and select their contents on focus.
Delivery quantity editing
src/modules/deliveryChallan/CreateDeliveryChallanModule.tsx
Delivery quantity state now permits zero during editing, uses the shared Input, resets new entries to zero, and restores line quantities below one on blur.
Inventory, invoice, and quotation field normalization
src/modules/inventory/InventoryModule.tsx, src/modules/invoices/CreateInvoiceModule.tsx, src/modules/quotations/CreateQuotationModule.tsx
Zero values display as empty in applicable fields, while editable quantities are restored to one on blur where required.

Estimated code review effort: 3 (Moderate) | ~20 minutes

Possibly related issues

Suggested reviewers: ateebnoone

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title is related to the main change, describing the input zero-handling fix, though the wording is a bit awkward.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

📥 Commits

Reviewing files that changed from the base of the PR and between 63d2279 and fcdf148.

📒 Files selected for processing (5)
  • src/components/ui/Input.tsx
  • src/modules/deliveryChallan/CreateDeliveryChallanModule.tsx
  • src/modules/inventory/InventoryModule.tsx
  • src/modules/invoices/CreateInvoiceModule.tsx
  • src/modules/quotations/CreateQuotationModule.tsx

Comment thread src/modules/inventory/InventoryModule.tsx
@AteebNoOne AteebNoOne linked an issue Jul 16, 2026 that may be closed by this pull request
@AteebNoOne
AteebNoOne merged commit cf21bb8 into iTeebot:main Jul 16, 2026
7 of 8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Improve numeric input editing by allowing removal of trailing zeros

2 participants