@@ -30,7 +30,12 @@ const getRowProps = (features: Features, props: RowProps) =>
3030 . map ( ( feature ) => ( feature as any ) . _getRowProps ( props , features ) ) ;
3131
3232const evaluateProps = ( rowPropsByFeature : FeatureProps [ ] , onSingleClick : OnClick | Nullish ) => {
33- const { themeByFeature, classNamesByFeature, onClickByFeature } = rowPropsByFeature . reduce (
33+ const {
34+ themeByFeature,
35+ classNamesByFeature,
36+ clickable,
37+ onClickByFeature,
38+ } = rowPropsByFeature . reduce (
3439 ( acc , value ) => {
3540 const { theme, className, onClick } = value ;
3641
@@ -41,6 +46,8 @@ const evaluateProps = (rowPropsByFeature: FeatureProps[], onSingleClick: OnClick
4146
4247 const mergedClassName = cs ( acc . classNamesByFeature , className ) ;
4348
49+ const mergedClickable = acc . clickable || ! ! onClick ;
50+
4451 const mergedOnClick = ( node : TableNode , event : React . SyntheticEvent ) => {
4552 onClick ( node , event ) ;
4653 acc . onClickByFeature ( node , event ) ;
@@ -50,12 +57,14 @@ const evaluateProps = (rowPropsByFeature: FeatureProps[], onSingleClick: OnClick
5057 ...acc ,
5158 themeByFeature : mergedTheme ,
5259 classNamesByFeature : mergedClassName ,
60+ clickable : mergedClickable ,
5361 onClickByFeature : mergedOnClick ,
5462 } ;
5563 } ,
5664 {
5765 themeByFeature : '' ,
5866 classNamesByFeature : '' ,
67+ clickable : ! ! onSingleClick ,
5968 onClickByFeature : ( node : TableNode , event : React . SyntheticEvent ) => {
6069 if ( onSingleClick && isRowClick ( event ) ) {
6170 onSingleClick ( node , event ) ;
@@ -67,6 +76,7 @@ const evaluateProps = (rowPropsByFeature: FeatureProps[], onSingleClick: OnClick
6776 return {
6877 themeByFeature,
6978 classNamesByFeature,
79+ clickable,
7080 onClickByFeature,
7181 } ;
7282} ;
@@ -79,7 +89,7 @@ export const Row: React.FC<RowProps> = (props: RowProps) => {
7989
8090 const theme = React . useContext ( ThemeContext ) ;
8191
82- const { themeByFeature, classNamesByFeature, onClickByFeature } = evaluateProps (
92+ const { themeByFeature, classNamesByFeature, clickable , onClickByFeature } = evaluateProps (
8393 rowPropsByFeature ,
8494 onClick ,
8595 ) ;
@@ -95,7 +105,7 @@ export const Row: React.FC<RowProps> = (props: RowProps) => {
95105 role = "row"
96106 className = { cs ( 'tr' , 'tr-body' , classNamesByFeature , className , {
97107 disabled,
98- clickable : onClickByFeature || onDoubleClick ,
108+ clickable : clickable || ! ! onDoubleClick ,
99109 } ) }
100110 css = { css `
101111 ${ themeByFeature }
0 commit comments