@@ -43,7 +43,10 @@ export const renderBtn = (data, prop ) => {
43
43
44
44
return React . createElement ( 'span' , {
45
45
className : cls . join ( ' ' ) ,
46
- onClick : ( e ) => typeof onExpand === 'function' && onExpand ( e , data )
46
+ onClick : ( e ) => {
47
+ e . stopPropagation ( ) ;
48
+ typeof onExpand === 'function' && onExpand ( e , data ) ;
49
+ }
47
50
} ) ;
48
51
} ;
49
52
@@ -52,6 +55,7 @@ export const renderLabel = (data, prop) => {
52
55
const node = prop . node ;
53
56
const label = data [ node . label ] ;
54
57
const renderContent = prop . renderContent ;
58
+ const onClick = prop . onClick ;
55
59
56
60
const childNodes = [ ] ;
57
61
if ( typeof renderContent === 'function' ) {
@@ -78,9 +82,10 @@ export const renderLabel = (data, prop) => {
78
82
79
83
return React . createElement ( 'div' , {
80
84
className : 'org-tree-node-label' ,
85
+ onClick : ( e ) => typeof onClick === 'function' && onClick ( e , data )
81
86
} , [ React . createElement ( 'div' , {
82
87
className : cls . join ( ' ' ) ,
83
- style : { width : labelWidth } ,
88
+ style : { width : labelWidth }
84
89
} , childNodes ) ] ) ;
85
90
} ;
86
91
0 commit comments