Skip to content

Commit a554d87

Browse files
authored
fix: Input type number validation on estimate in create and update (#4917)
1 parent dcbd974 commit a554d87

File tree

2 files changed

+8
-4
lines changed

2 files changed

+8
-4
lines changed

web/core/components/estimates/points/create.tsx

+4-2
Original file line numberDiff line numberDiff line change
@@ -58,8 +58,10 @@ export const EstimatePointCreate: FC<TEstimatePointCreate> = observer((props) =>
5858
};
5959

6060
const handleEstimateInputValue = (value: string) => {
61-
setEstimateInputValue(value);
62-
handleEstimatePointError && handleEstimatePointError(value, undefined);
61+
if (value.length <= MAX_ESTIMATE_POINT_INPUT_LENGTH) {
62+
setEstimateInputValue(value);
63+
handleEstimatePointError && handleEstimatePointError(value, undefined);
64+
}
6365
};
6466

6567
const handleCreate = async (event: FormEvent<HTMLFormElement>) => {

web/core/components/estimates/points/update.tsx

+4-2
Original file line numberDiff line numberDiff line change
@@ -63,8 +63,10 @@ export const EstimatePointUpdate: FC<TEstimatePointUpdate> = observer((props) =>
6363
};
6464

6565
const handleEstimateInputValue = (value: string) => {
66-
handleEstimatePointError && handleEstimatePointError(value, undefined);
67-
setEstimateInputValue(() => value);
66+
if (value.length <= MAX_ESTIMATE_POINT_INPUT_LENGTH) {
67+
setEstimateInputValue(() => value);
68+
handleEstimatePointError && handleEstimatePointError(value, undefined);
69+
}
6870
};
6971

7072
const handleUpdate = async (event: FormEvent<HTMLFormElement>) => {

0 commit comments

Comments
 (0)