prevent proposed amount to get negetive values
This commit is contained in:
@@ -41,7 +41,9 @@ const ConfirmForm = ({ open, handleClose, rowId, confirmData }) => {
|
|||||||
setDescription(event.target.value);
|
setDescription(event.target.value);
|
||||||
};
|
};
|
||||||
const handleAmountChange = (event) => {
|
const handleAmountChange = (event) => {
|
||||||
setProposedAmount(event.target.value);
|
if (/^\d*$/.test(event.target.value)) {
|
||||||
|
setProposedAmount(event.target.value);
|
||||||
|
}
|
||||||
formik.handleChange(event);
|
formik.handleChange(event);
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -65,6 +67,11 @@ const ConfirmForm = ({ open, handleClose, rowId, confirmData }) => {
|
|||||||
name="proposed_amount"
|
name="proposed_amount"
|
||||||
label={t("MachinaryOffice.proposed_amount")}
|
label={t("MachinaryOffice.proposed_amount")}
|
||||||
type="number"
|
type="number"
|
||||||
|
inputProps={{
|
||||||
|
min: 0,
|
||||||
|
inputMode: "numeric",
|
||||||
|
pattern: "[0-9]*",
|
||||||
|
}}
|
||||||
variant="outlined"
|
variant="outlined"
|
||||||
value={proposedAmount}
|
value={proposedAmount}
|
||||||
onChange={handleAmountChange}
|
onChange={handleAmountChange}
|
||||||
|
|||||||
Reference in New Issue
Block a user