File tree Expand file tree Collapse file tree 3 files changed +23
-12
lines changed Expand file tree Collapse file tree 3 files changed +23
-12
lines changed Original file line number Diff line number Diff line change @@ -30,20 +30,23 @@ class CheckboxGroup extends React.Component {
30
30
inline,
31
31
} = this . props ;
32
32
33
- const classNames = cx ( styles [ 'checkbox-group' ] , { inline } ) ;
33
+ const classNames = cx ( styles [ 'checkbox-group' ] ) ;
34
34
return options . map ( option => (
35
- < div key = { option . label } className = { classNames } >
36
- < div className = { styles [ 'each-check' ] } >
37
- < Checkbox
38
- { ...option }
39
- checked = { this . state . isChecked [ option . label ] }
40
- onClick = { this . handleCheckListChange }
41
- />
42
- < label className = { styles [ 'each-label' ] } >
43
- { option . label }
44
- </ label >
35
+ < React . Fragment key = { option . label } >
36
+ < div className = { classNames } >
37
+ < div className = { cx ( styles [ 'each-check' ] , { inline } ) } >
38
+ < Checkbox
39
+ { ...option }
40
+ checked = { this . state . isChecked [ option . label ] }
41
+ onClick = { this . handleCheckListChange }
42
+ />
43
+ < label className = { styles [ 'each-label' ] } >
44
+ { option . label }
45
+ </ label >
46
+ </ div >
45
47
</ div >
46
- </ div >
48
+ < div className = "clearfix" />
49
+ </ React . Fragment >
47
50
) ) ;
48
51
}
49
52
}
Original file line number Diff line number Diff line change 1
1
:local(.checkbox-group ) {
2
2
3
+ .clearfix {
4
+ clear : both ;
5
+ }
3
6
}
4
7
5
8
:local(.each-check ) {
9
+ & .inline {
10
+ float : left ;
11
+ margin-right : 25px ;
12
+ }
6
13
margin-bottom : 10px ;
7
14
}
8
15
Original file line number Diff line number Diff line change @@ -21,6 +21,7 @@ const CheckboxDemo = () => (
21
21
< React . Fragment >
22
22
< CheckboxGroup
23
23
options = { options }
24
+ inline
24
25
/>
25
26
</ React . Fragment >
26
27
) ;
You can’t perform that action at this time.
0 commit comments