diff --git a/web/core/components/estimates/points/create.tsx b/web/core/components/estimates/points/create.tsx index 9cd7d1e7c..274b19d90 100644 --- a/web/core/components/estimates/points/create.tsx +++ b/web/core/components/estimates/points/create.tsx @@ -149,6 +149,15 @@ export const EstimatePointCreate: FC = observer((props) => } else handleEstimatePointError && handleEstimatePointError(estimateInputValue, "Estimate value cannot be empty."); }; + // derived values + const inputFieldType = + estimateType && [(EEstimateSystem.TIME, EEstimateSystem.POINTS)].includes(estimateType) ? "number" : "text"; + const inputProps = { + type: inputFieldType, + pattern: inputFieldType === "number" ? "[0-9]*" : undefined, + maxlength: inputFieldType === "number" ? undefined : 24, + }; + return (
= observer((props) => )} > handleEstimateInputValue(e.target.value)} className="border-none focus:ring-0 focus:border-0 focus:outline-none p-2.5 w-full bg-transparent" placeholder="Enter estimate point" autoFocus + {...inputProps} /> {estimatePointError?.message && ( = observer((props) => handleEstimatePointError && handleEstimatePointError(estimateInputValue || "", "Estimate value cannot be empty."); }; + // derived values + const inputFieldType = + estimateType && [(EEstimateSystem.TIME, EEstimateSystem.POINTS)].includes(estimateType) ? "number" : "text"; + const inputProps = { + type: inputFieldType, + pattern: inputFieldType === "number" ? "[0-9]*" : undefined, + maxlength: inputFieldType === "number" ? undefined : 24, + }; + return (
= observer((props) => )} > handleEstimateInputValue(e.target.value)} className="border-none focus:ring-0 focus:border-0 focus:outline-none p-2.5 w-full bg-transparent" placeholder="Enter estimate point" autoFocus + {...inputProps} /> {estimatePointError?.message && ( <>