Skip to content

Commit

Permalink
🐛 Review form, fix onChange handlers (#1839)
Browse files Browse the repository at this point in the history
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 <sdickers@redhat.com>
Co-authored-by: Ian Bolton <ibolton@redhat.com>
Signed-off-by: Cherry Picker <noreply@github.com>
  • Loading branch information
2 people authored and web-flow committed Apr 15, 2024
1 parent 21d95f6 commit 3143726
Showing 1 changed file with 10 additions and 14 deletions.
24 changes: 10 additions & 14 deletions client/src/app/pages/review/components/review-form/review-form.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -222,13 +222,11 @@ export const ReviewForm: React.FC<IReviewFormProps> = ({
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)}
/>
)}
/>
Expand All @@ -247,13 +245,11 @@ export const ReviewForm: React.FC<IReviewFormProps> = ({
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)}
/>
)}
/>
Expand Down

0 comments on commit 3143726

Please sign in to comment.