grouped-checkboxes
grouped-checkboxes copied to clipboard
individual checkbox remains selected even after the state change
The below is the snippet.
there is term list, when user selects a term, the below component is called and a new term details is passed. But the issue is , if i have selected a checkbox for term1 and the same checkbox remain selected for term2 and so on as well.
Please help. I am state inside class component.
const Sentences = ({term,onCheckboxChanged})=>(
<CheckboxGroup onChange={onCheckboxChanged} >
<table>
<thead>
<tr>
<th width="5%" className="text-center"> <AllCheckerCheckbox /></th>
<th>All</th>
</tr>
</thead>
<tbody>
{term.sentences.map((sentence,index) =>
<tr>
<td className="text-center align-top"><Checkbox className="checkbox" value={index} /></td>
<td>{sentence}</td>
</tr>
)}
</tbody>
</table>
Can you create a codesandbox showing the bug?