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