Skip to content

Commit

Permalink
fix radio group
Browse files Browse the repository at this point in the history
  • Loading branch information
eric-burel committed May 6, 2022
1 parent 02687a1 commit ef11fa2
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions packages/react-ui/components/form/inputs/RadioGroup.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,15 @@ import { useVulcanComponents } from "../../VulcanComponents/Consumer";
* @returns
*/
export const FormComponentRadioGroup = (props: FormInputProps) => {
const { path, inputProperties, options = [], itemProperties } = props;
const {
value: propsValue,
path,
inputProperties,
options = [],
itemProperties,
} = props;
// NOTE: inputProperties.value is undefined
// use "props.value" instead
const { label, name } = inputProperties;
if (!Array.isArray(options))
throw new Error("RadioGroup not yet supporting functional options");
Expand Down Expand Up @@ -35,7 +43,7 @@ export const FormComponentRadioGroup = (props: FormInputProps) => {
key={value}
{...inputProperties}
value={value}
checked={value === inputProperties.value}
checked={value === propsValue}
/>
</div>
);
Expand Down

0 comments on commit ef11fa2

Please sign in to comment.