redux-form-material-ui icon indicating copy to clipboard operation
redux-form-material-ui copied to clipboard

Unable to set Checkbox to selected/unselected via code

Open vishal1785 opened this issue 7 years ago • 1 comments

I have a use case where I want to select the chkbox on the basis of data which I'm reading from an API.

So, If that particular checkbox was selected while posting to the data to the server, I want to make it selected then next time user looks for the same record.

I'm using these components: FormControlLabel from '@material-ui/core/FormControlLabel' Checkbox from 'redux-form-material-ui' and redux form

My Code is something like this- <FormControlLabel control={ <Field name={${this.props.postParam}.${key}} checked={ // some condition here on basis of remote api data } component={this.checkboxAdapter} /> }

checkboxAdapter(inputProps) { console.log(inputProps) return ( <Checkbox {...inputProps} value={inputProps.input.value} onChange={inputProps.input.onChange} checked={inputProps.checked} />); }

vishal1785 avatar Aug 07 '18 21:08 vishal1785

This is still an issue, any progress?

xavierfuentes avatar Dec 22 '18 14:12 xavierfuentes