Skip to content

Commit

Permalink
Add custom class to checkbox
Browse files Browse the repository at this point in the history
  • Loading branch information
lqminh268 committed Sep 9, 2023
1 parent 3bbe0d7 commit f7f6e9c
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/tree-node/node-label.js
Original file line number Diff line number Diff line change
Expand Up @@ -50,20 +50,22 @@ class NodeLabel extends PureComponent {
}

const sharedProps = { id, value, checked, disabled, readOnly, tabIndex: -1 }
const className = ['checkbox-item', mode === 'simpleSelect' && 'simple-select'].filter(Boolean).join(' ')
const className = ['checkbox-item form-check-input', mode === 'simpleSelect' && 'simple-select'].filter(Boolean).join(' ')

return (
<label title={title || label} htmlFor={id}>
{mode === 'radioSelect' ? (
<RadioButton name={clientId} className="radio-item" onChange={this.handleCheckboxChange} {...sharedProps} />
) : (
<Checkbox
<div className='form-check'>
<Checkbox
name={id}
className={className}
indeterminate={showPartiallySelected && partial}
onChange={this.handleCheckboxChange}
{...sharedProps}
/>
</div>
)}
<span {...nodeLabelProps}>{label}</span>
</label>
Expand Down

0 comments on commit f7f6e9c

Please sign in to comment.