question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

checkboxGroup cannot check all after custom label data

See original GitHub issue
  • I have searched the issues of this repository and believe that this is not a duplicate.

What problem does this feature solve?

I need to add some tag elements to the label,But when I use the following function,checkall invalid。

getPlainOptions(){
	const { list }=this.props
	const newLists = list.map(item=> {
		const newList = {...item};
		newList.label = <span className={styles.checklist}><img src={item.avatar} /><span>{item.name}</span></span>;
		newList.value = item.userid;
		return newList;
	})
	return newLists
}

<Checkbox
  	indeterminate={this.state.indeterminate}
        onChange={this.onCheckAllChange}
        checked={this.state.checkAll}
       >Check All</Checkbox>
<CheckboxGroup className={styles.checkGroup} options={this.plainOptions}   value={this.state.checkedList} onChange={this.onChange}  />

What does the proposed API look like?

I hope this is effective.

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:7 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
wei494989879commented, Apr 16, 2018

My own temporary solution is to expand the array, `onCheckAllChange = (e) => {

this.setState({
  checkedList: e.target.checked ? this.plainOptions.map(item=> {return item.userid}) : [],
  checkAll: e.target.checked,
});

}`;

0reactions
ant-design-botcommented, May 3, 2018

This issue is closed because it has been marked as Need Reproduce, but has not had recent activity. If you can provide a reproduce, feel free to ping anyone of our maintainers to reopen this issue. Thank you for your contributions.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Need to save which checkboxes will be shown as options
I have these checkboxes on a page and on another page I have these same checkboxes. <div data-role="content" data-theme="a"> ...
Read more >
How to ungroup Checkboxes - ServiceNow Community
If there is no custom label, check boxes are grouped under an Options label by the application. In a group of check box...
Read more >
How To Create a Custom Checkbox - W3Schools
Learn how to create custom checkboxes and radio buttons with CSS. ... <input type="checkbox" checked="checked"> ... .container .checkmark:after { left: 9px;
Read more >
ARIA: checkbox role - Accessibility - MDN Web Docs - Mozilla
Since a checkbox is an interactive control, it must be focusable and keyboard accessible. If the role is applied to a non-focusable element,...
Read more >
Checkbox - Ant Design
Checkbox component. ... Basic usage of checkbox. expand code. TypeScript ... The indeterminate property can help you to achieve a 'check all' effect....
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found