fix: prevent negative numeric inputs in rental forms by enforcing positive constraints and sanitizing user entries
This commit is contained in:
@@ -609,8 +609,9 @@ export default function RentalDetailPage() {
|
||||
<label className="text-sm text-slate-600">Due Amount (৳)</label>
|
||||
<input
|
||||
type="number"
|
||||
min={0}
|
||||
value={dueAmount}
|
||||
onChange={(e) => setDueAmount(Number(e.target.value))}
|
||||
onChange={(e) => setDueAmount(Math.max(0, Number(e.target.value)))}
|
||||
className="w-full px-3 py-2 border border-slate-200 rounded-lg text-sm mt-1"
|
||||
placeholder="Enter amount..."
|
||||
/>
|
||||
|
||||
Reference in New Issue
Block a user