Skip to content

Commit 099da42

Browse files
author
Asgator
committed
Checkbox: add onClick in defaultProps
1 parent d454864 commit 099da42

File tree

1 file changed

+34
-7
lines changed

1 file changed

+34
-7
lines changed

src/components/modules/checkbox/checkbox.jsx

Lines changed: 34 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -6,20 +6,47 @@ export default class Checkbox extends Component {
66
static propTypes = {
77
...DefaultProps.propTypes,
88

9+
/**
10+
* State checked
11+
*/
912
checked: React.PropTypes.bool,
13+
/**
14+
* Does not allow user interaction
15+
*/
1016
disabled: React.PropTypes.bool,
11-
fitted: React.PropTypes.bool,
12-
indeterminate: React.PropTypes.bool,
13-
name: React.PropTypes.string,
17+
/**
18+
* It does disabled, but does not allow user interaction
19+
*/
20+
readOnly: React.PropTypes.bool,
21+
/**
22+
* Callback handler to click checkbox
23+
*/
1424
onClick: React.PropTypes.func,
25+
/**
26+
* Checkbox - appearance
27+
*/
1528
radio: React.PropTypes.bool,
16-
readOnly: React.PropTypes.bool,
29+
/**
30+
* Attr name
31+
*/
32+
name: React.PropTypes.string,
33+
/**
34+
* Checkbox - appearance
35+
*/
1736
slider: React.PropTypes.bool,
18-
toggle: React.PropTypes.bool
37+
/**
38+
* Checkbox - appearance
39+
*/
40+
toggle: React.PropTypes.bool,
41+
/**
42+
* A fitted checkbox does not leave padding for a label
43+
*/
44+
fitted: React.PropTypes.bool
1945
};
2046

2147
static defaultProps = {
22-
...DefaultProps.defaultProps
48+
...DefaultProps.defaultProps,
49+
onClick: () => { }
2350
};
2451

2552
onClick = (event) => {
@@ -52,7 +79,7 @@ export default class Checkbox extends Component {
5279

5380
render() {
5481
/* eslint-disable no-use-before-define */
55-
let { component, defaultClasses, name, checked, onClick, ...other } = this.props;
82+
let { component, defaultClasses, checked, onClick, name, ...other } = this.props;
5683
/* eslint-enable no-use-before-define */
5784

5885
other.className = classNames(this.props.className, this.getClasses());

0 commit comments

Comments
 (0)