fix: Input type number validation on estimate in create and update (#4917)

This commit is contained in:
guru_sainath 2024-06-24 13:49:31 +05:30 committed by GitHub
parent dcbd974ac5
commit a554d87531
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 8 additions and 4 deletions

View file

@ -58,8 +58,10 @@ export const EstimatePointCreate: FC<TEstimatePointCreate> = observer((props) =>
};
const handleEstimateInputValue = (value: string) => {
setEstimateInputValue(value);
handleEstimatePointError && handleEstimatePointError(value, undefined);
if (value.length <= MAX_ESTIMATE_POINT_INPUT_LENGTH) {
setEstimateInputValue(value);
handleEstimatePointError && handleEstimatePointError(value, undefined);
}
};
const handleCreate = async (event: FormEvent<HTMLFormElement>) => {

View file

@ -63,8 +63,10 @@ export const EstimatePointUpdate: FC<TEstimatePointUpdate> = observer((props) =>
};
const handleEstimateInputValue = (value: string) => {
handleEstimatePointError && handleEstimatePointError(value, undefined);
setEstimateInputValue(() => value);
if (value.length <= MAX_ESTIMATE_POINT_INPUT_LENGTH) {
setEstimateInputValue(() => value);
handleEstimatePointError && handleEstimatePointError(value, undefined);
}
};
const handleUpdate = async (event: FormEvent<HTMLFormElement>) => {