Skip to content

Commit

Permalink
Fixed radio buttons to clear
Browse files Browse the repository at this point in the history
  • Loading branch information
Khalid committed Jan 18, 2022
1 parent 41c10c7 commit b9eb02e
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions components/Forms/Radio.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,16 @@ export interface InputProps extends InputHTMLAttributes<HTMLInputElement> {
* @returns
*/
export const Radio: React.VFC<InputProps> = observer((props) => {
const { name, label, checkedValue, onChange, values, keyforid, error } = props
const {
name,
label,
checkedValue,
value,
onChange,
values,
keyforid,
error,
} = props

return (
<>
Expand Down Expand Up @@ -47,7 +56,7 @@ export const Radio: React.VFC<InputProps> = observer((props) => {
value={val.key}
onChange={onChange}
required
defaultChecked={checkedValue === correctForBooleans(val.key)}
checked={checkedValue === correctForBooleans(val.key)}
/>
<label
htmlFor={`${keyforid}-${index}`}
Expand Down

0 comments on commit b9eb02e

Please sign in to comment.