From a554d875319456dd9335656c2eed7dbc88583620 Mon Sep 17 00:00:00 2001 From: guru_sainath Date: Mon, 24 Jun 2024 13:49:31 +0530 Subject: [PATCH] fix: Input type number validation on estimate in create and update (#4917) --- web/core/components/estimates/points/create.tsx | 6 ++++-- web/core/components/estimates/points/update.tsx | 6 ++++-- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/web/core/components/estimates/points/create.tsx b/web/core/components/estimates/points/create.tsx index 89a4dbaf3..0c05beaba 100644 --- a/web/core/components/estimates/points/create.tsx +++ b/web/core/components/estimates/points/create.tsx @@ -58,8 +58,10 @@ export const EstimatePointCreate: FC = 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) => { diff --git a/web/core/components/estimates/points/update.tsx b/web/core/components/estimates/points/update.tsx index 747d2b64d..cde02c2a0 100644 --- a/web/core/components/estimates/points/update.tsx +++ b/web/core/components/estimates/points/update.tsx @@ -63,8 +63,10 @@ export const EstimatePointUpdate: FC = 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) => {