Availity / availity-reactstrap-validation

Easy to use React validation components compatible for reactstrap.
https://availity.github.io/availity-reactstrap-validation/
MIT License
191 stars 70 forks source link

fix: checkbox default value was not being accepted properly #131

Closed GoPro16 closed 5 years ago

GoPro16 commented 5 years ago

When using the model prop on the AvForm, you should be able to pass in an array of names for the components you want to be checked by default in the AvCheckboxGroup. However, the valueArr in this case when using the filter method returns an array of size 0. Instead we can just use the lodash/find property to make sure that if the item is not found that it returns null.

Also should the below line not be using this.props.name and not the actual value prop passed into the checkbox? https://github.com/Availity/availity-reactstrap-validation/blob/a0f73b710a1a5063cf2877b6f6ff807b53004719/src/AvCheckbox.js#L33-L35

netlify[bot] commented 5 years ago

Deploy preview for availity-reactstrap-validation ready!

Built with commit 8e4227cdc2296bb7045a84f401dee7b8c7eac005

https://deploy-preview-131--availity-reactstrap-validation.netlify.com