@@ -43,7 +43,10 @@ export const renderBtn = (data, prop ) => {
4343
4444 return React . createElement ( 'span' , {
4545 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+ }
4750 } ) ;
4851} ;
4952
@@ -52,6 +55,7 @@ export const renderLabel = (data, prop) => {
5255 const node = prop . node ;
5356 const label = data [ node . label ] ;
5457 const renderContent = prop . renderContent ;
58+ const onClick = prop . onClick ;
5559
5660 const childNodes = [ ] ;
5761 if ( typeof renderContent === 'function' ) {
@@ -78,9 +82,10 @@ export const renderLabel = (data, prop) => {
7882
7983 return React . createElement ( 'div' , {
8084 className : 'org-tree-node-label' ,
85+ onClick : ( e ) => typeof onClick === 'function' && onClick ( e , data )
8186 } , [ React . createElement ( 'div' , {
8287 className : cls . join ( ' ' ) ,
83- style : { width : labelWidth } ,
88+ style : { width : labelWidth }
8489 } , childNodes ) ] ) ;
8590} ;
8691
0 commit comments