Skip to content

Commit b4b04c6

Browse files
author
Domino987
committed
chore: removla of wrong spreaded values of tablecell
1 parent 72c5c1b commit b4b04c6

File tree

1 file changed

+17
-7
lines changed

1 file changed

+17
-7
lines changed

src/components/MTableCell/index.js

Lines changed: 17 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -6,22 +6,32 @@ import { getRenderValue, getStyle } from './utils';
66
/* eslint-enable no-unused-vars */
77

88
function MTableCell(props) {
9+
const {
10+
forwardedRef,
11+
scrollWidth,
12+
rowData,
13+
onCellEditStarted,
14+
cellEditable,
15+
columnDef,
16+
errorState,
17+
...spreadProps
18+
} = props;
919
const handleClickCell = (e) => {
1020
if (props.columnDef.disableClick) {
1121
e.stopPropagation();
1222
}
1323
};
1424

1525
const cellAlignment =
16-
props.columnDef.align !== undefined
17-
? props.columnDef.align
18-
: ['numeric', 'currency'].indexOf(props.columnDef.type) !== -1
26+
columnDef.align !== undefined
27+
? columnDef.align
28+
: ['numeric', 'currency'].indexOf(columnDef.type) !== -1
1929
? 'right'
2030
: 'left';
2131

2232
let renderValue = getRenderValue(props);
2333

24-
if (props.cellEditable) {
34+
if (cellEditable) {
2535
renderValue = (
2636
<div
2737
style={{
@@ -31,7 +41,7 @@ function MTableCell(props) {
3141
}}
3242
onClick={(e) => {
3343
e.stopPropagation();
34-
props.onCellEditStarted(props.rowData, props.columnDef);
44+
onCellEditStarted(rowData, columnDef);
3545
}}
3646
>
3747
{renderValue}
@@ -41,13 +51,13 @@ function MTableCell(props) {
4151

4252
return (
4353
<TableCell
44-
{...props}
54+
{...spreadProps}
4555
size={props.size}
4656
value={props.value}
4757
style={getStyle(props)}
4858
align={cellAlignment}
4959
onClick={handleClickCell}
50-
ref={props.forwardedRef}
60+
ref={forwardedRef}
5161
colSpan={props.colSpan}
5262
>
5363
{props.children}

0 commit comments

Comments
 (0)