From 182600094f4ab906043ee4034fefb0367445c45e Mon Sep 17 00:00:00 2001 From: Scott J Dickerson Date: Thu, 11 Apr 2024 12:43:31 -0400 Subject: [PATCH] :bug: Review form, fix `onChange` handlers On the review form, fix the `onChange` handler for the following `NumberInput` fields: - criticality - priority Note: This fix is a follow up to the fix in #1831. A grep across the codebase showed 2 more or the same problems. Signed-off-by: Scott J Dickerson --- .../components/review-form/review-form.tsx | 24 ++++++++----------- 1 file changed, 10 insertions(+), 14 deletions(-) diff --git a/client/src/app/pages/review/components/review-form/review-form.tsx b/client/src/app/pages/review/components/review-form/review-form.tsx index 3ebcfecb6..450bc283b 100644 --- a/client/src/app/pages/review/components/review-form/review-form.tsx +++ b/client/src/app/pages/review/components/review-form/review-form.tsx @@ -222,13 +222,11 @@ export const ReviewForm: React.FC = ({ value={value} min={1} max={10} - onMinus={() => { - onChange((value || 0) - 1); - }} - onChange={() => onChange} - onPlus={() => { - onChange((value || 0) + 1); - }} + onMinus={() => onChange((value || 0) - 1)} + onChange={(event) => + onChange((event.target as HTMLInputElement).value) + } + onPlus={() => onChange((value || 0) + 1)} /> )} /> @@ -247,13 +245,11 @@ export const ReviewForm: React.FC = ({ value={value} min={1} max={10} - onMinus={() => { - onChange((value || 0) - 1); - }} - onChange={() => onChange} - onPlus={() => { - onChange((value || 0) + 1); - }} + onMinus={() => onChange((value || 0) - 1)} + onChange={(event) => + onChange((event.target as HTMLInputElement).value) + } + onPlus={() => onChange((value || 0) + 1)} /> )} />