From 3143726bd576a9d9e6d0ccb1c602e01d4e8520b0 Mon Sep 17 00:00:00 2001 From: Scott Dickerson Date: Mon, 15 Apr 2024 13:29:06 -0400 Subject: [PATCH] :bug: Review form, fix `onChange` handlers (#1839) 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. Resolves: #1844 Signed-off-by: Scott J Dickerson Co-authored-by: Ian Bolton Signed-off-by: Cherry Picker --- .../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)} /> )} />