cosmos
cosmos copied to clipboard
repeated 'name' attribute in Checkbox docs
Describe the bug In docs, the "name" attribute for the checkbox is repeated if the name value is user defined
Expected behavior Replace the previous value of the "name" attribute.
Screenshots

@rakhi2104 can I take up this issue?
I'm actually working on this. :space_invader: Oops !
Ok no problem :)
@siddharthkp, the name="example" is in the checkbox.md which is being rendered on the playground. We need to do a specific workaround for this checkbox item. All other components, to my knowledge, are free of this bug.
Found out that the select component also has the same problem

Hey!
This isn't documented in the contribution guide but we do a way of writing code that works with the prop table
Note: It's part of the codebase is super hacky and scheduled for a rewrite
Adding {props} connects it to the prop table
Adding defaults let's you pass values that used for the example and can be changed from the prop table (supports only number/string props right now)
Other props that you add are hardcoded and will create duplicates when changed in the prop table
Example:
<Select
{props} defaults={{placeholder: ""Select an option..."}}
options={[
{ text: 'One', value: 1 },
{ text: 'Two', value: 2 },
{ text: 'Three', value: 3 }
]}
onChange={ event => console.log(event) }
/>