andrewhathaway / Winterfell

Generate complex, validated and extendable JSON-based forms in React.
http://winterfell.andrewhathaway.net
MIT License
785 stars 116 forks source link

How can I make a checkbox to be checked by default? #30

Closed algm closed 9 years ago

algm commented 9 years ago

After some tests, I am unable to set a checkbox as checked by default. I am reading the code and I don't see any way the checkboxInput component can accomplish that.

Am I missing anything? Should I try to do it and send a PR?

Thanks!

andrewhathaway commented 9 years ago

Ah. Interesting.

Looking through the source and the single checkboxInput input type always sets the checked value to false, however a checkboxOptionsInput works as expected.

I'd suggest it'd be a good idea to fix this and PR it if possible!

Thanks!

andrewhathaway commented 9 years ago

It might be worth also fixing the default issue with the checkboxInput input type. Can you PR or shall I put it on my backlog?

algm commented 9 years ago

I'll do it in the next few days don't worry ;)