Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bug with checkboxbuttons default values #33

Open
adam-clarey opened this issue Jun 3, 2016 · 2 comments
Open

Bug with checkboxbuttons default values #33

adam-clarey opened this issue Jun 3, 2016 · 2 comments

Comments

@adam-clarey
Copy link

Currently default values will only be applied if there is more than one field set as 'checked'.

I've found and fixed the issue and supplied the patch. Essentially, the onBeforeRender function expects the values to be in an array, but a single value does not appear in an array.
checkboxes-defaults.patch.txt

@adam-clarey
Copy link
Author

Correction patch, the values need to be in an array, so this patch puts a single value into an array
checkboxes-defaults.patch.txt

@ulion
Copy link
Owner

ulion commented Jun 3, 2016

checkboxbuttons expect the value be an array.

so either your default value, or the preloaded value, should be an array.
it's not the code's responsibility to fix the value type imo.

2016-06-03 18:10 GMT+08:00 adam-clarey notifications@github.com:

Correction patch, the values need to be in an array, so this patch puts a
single value into an array
checkboxes-defaults.patch.txt
https://github.com/ulion/jsonform/files/297376/checkboxes-defaults.patch.txt


You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
#33 (comment), or mute
the thread
https://github.com/notifications/unsubscribe/AAKsHaS6TByWQ5DN5eLuJN2s3GD6pr4Yks5qH_2QgaJpZM4ItWQt
.

Ulion

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants