Workday / canvas-kit

Development kits to implement UI following the Workday Canvas Design System (https://canvas.workday.com/). See our Component Storybook -
https://workday.github.io/canvas-kit/
Apache License 2.0
301 stars 221 forks source link

RadioGroup Preview should work based on index. #2937

Open mannycarrera4 opened 1 month ago

mannycarrera4 commented 1 month ago

🐛 Bug Report

In Radio Main, we map over children and give it a default value : https://github.com/Workday/canvas-kit/blob/master/modules/react/radio/lib/RadioGroup.tsx#L74

In preview if you don't provide a value it doesn't default by using the index of the radio input. Should this work by default? Technically this is a change in the API. In Preview, you have to explicitly define a value in order for the radio to work.