File tree 1 file changed +31
-28
lines changed
1 file changed +31
-28
lines changed Original file line number Diff line number Diff line change @@ -197,34 +197,37 @@ class TreeNode extends React.Component {
197
197
const clickable = onClick . toString ( ) !== TreeNode . defaultProps . onClick . toString ( ) ;
198
198
const inputId = `${ treeId } -${ value . split ( ' ' ) . join ( '_' ) } ` ;
199
199
200
- return (
201
- < span >
202
- < label htmlFor = { inputId } >
203
- < NativeCheckbox
204
- checked = { checked === 1 }
205
- disabled = { disabled }
206
- id = { inputId }
207
- indeterminate = { checked === 2 }
208
- onChange = { this . onCheck }
209
- />
210
- < span className = "rct-checkbox" >
211
- { this . renderCheckboxIcon ( ) }
212
- </ span >
213
- { ! clickable ? children : null }
214
- </ label >
215
- { clickable ? (
216
- < span
217
- className = "rct-node-clickable"
218
- onClick = { this . onClick }
219
- onKeyPress = { this . onClick }
220
- role = "link"
221
- tabIndex = { 0 }
222
- >
223
- { children }
224
- </ span >
225
- ) : null }
226
- </ span >
227
- ) ;
200
+ const render = [ (
201
+ < label htmlFor = { inputId } >
202
+ < NativeCheckbox
203
+ checked = { checked === 1 }
204
+ disabled = { disabled }
205
+ id = { inputId }
206
+ indeterminate = { checked === 2 }
207
+ onChange = { this . onCheck }
208
+ />
209
+ < span className = "rct-checkbox" >
210
+ { this . renderCheckboxIcon ( ) }
211
+ </ span >
212
+ { ! clickable ? children : null }
213
+ </ label >
214
+ ) ] ;
215
+
216
+ if ( clickable ) {
217
+ render . push ( (
218
+ < span
219
+ className = "rct-node-clickable"
220
+ onClick = { this . onClick }
221
+ onKeyPress = { this . onClick }
222
+ role = "link"
223
+ tabIndex = { 0 }
224
+ >
225
+ { children }
226
+ </ span >
227
+ ) ) ;
228
+ }
229
+
230
+ return render ;
228
231
}
229
232
230
233
renderLabel ( ) {
You can’t perform that action at this time.
0 commit comments