File tree Expand file tree Collapse file tree 3 files changed +16
-1
lines changed Expand file tree Collapse file tree 3 files changed +16
-1
lines changed Original file line number Diff line number Diff line change 1
1
# CHANGELOG
2
2
3
+ ## v1.2.3 (TBA)
4
+
5
+ ### Bug Fixes
6
+
7
+ * [ #81 ] : Fix render errors for all numeric value types
8
+
3
9
## [ v1.2.2] ( https://github.com/jakezatecky/react-checkbox-tree/compare/v1.2.1...v1.2.2 ) (2018-05-24)
4
10
5
11
### Bug Fixes
Original file line number Diff line number Diff line change @@ -195,7 +195,7 @@ class TreeNode extends React.Component {
195
195
} = this . props ;
196
196
197
197
const clickable = onClick . toString ( ) !== TreeNode . defaultProps . onClick . toString ( ) ;
198
- const inputId = `${ treeId } -${ Number . isInteger ( value ) ? value : value . split ( ' ' ) . join ( '_' ) } ` ;
198
+ const inputId = `${ treeId } -${ String ( value ) . split ( ' ' ) . join ( '_' ) } ` ;
199
199
200
200
const render = [ (
201
201
< label key = { 0 } htmlFor = { inputId } >
Original file line number Diff line number Diff line change @@ -45,6 +45,15 @@ describe('<TreeNode />', () => {
45
45
assert . equal ( 'planets-0' , wrapper . find ( 'label' ) . prop ( 'htmlFor' ) ) ;
46
46
assert . equal ( 'planets-0' , wrapper . find ( 'label NativeCheckbox' ) . prop ( 'id' ) ) ;
47
47
} ) ;
48
+
49
+ it ( 'should render a label associated with a checkbox given float value' , ( ) => {
50
+ const wrapper = shallow (
51
+ < TreeNode { ...baseProps } treeId = "planets" value = { 0.25 } /> ,
52
+ ) ;
53
+
54
+ assert . equal ( 'planets-0.25' , wrapper . find ( 'label' ) . prop ( 'htmlFor' ) ) ;
55
+ assert . equal ( 'planets-0.25' , wrapper . find ( 'label NativeCheckbox' ) . prop ( 'id' ) ) ;
56
+ } ) ;
48
57
} ) ;
49
58
50
59
describe ( 'checked' , ( ) => {
You can’t perform that action at this time.
0 commit comments