Skip to content

Commit

Permalink
Merge pull request #243 from mashabow/fix-radio-number
Browse files Browse the repository at this point in the history
Correctly set `<RadioButtonGroup type="number">` value as a number
  • Loading branch information
dohomi authored Mar 28, 2024
2 parents 722a77b + a8fbe66 commit e844ada
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion packages/rhf-mui/src/RadioButtonGroup.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,8 @@ const RadioButtonGroup = forwardRef(function RadioButtonGroup<
: helperText

const onRadioChange = (event: ChangeEvent<HTMLInputElement>) => {
const radioValue = (event.target as HTMLInputElement).value
const radioValue =
type === 'number' ? Number(event.target.value) : event.target.value
const returnValue = returnObject
? options.find((items) => items[valueKey] === radioValue)
: radioValue
Expand Down

0 comments on commit e844ada

Please sign in to comment.