File tree Expand file tree Collapse file tree 2 files changed +11
-2
lines changed Expand file tree Collapse file tree 2 files changed +11
-2
lines changed Original file line number Diff line number Diff line change @@ -40,6 +40,7 @@ function Cell<R, SR>(
4040 onContextMenu,
4141 onRowChange,
4242 selectCell,
43+ style,
4344 ...props
4445 } : CellRendererProps < R , SR > ,
4546 ref : React . Ref < HTMLDivElement >
@@ -93,6 +94,14 @@ function Cell<R, SR>(
9394 onRowChange ( column , newRow ) ;
9495 }
9596
97+ const cellStyle = getCellStyle ( column , colSpan ) ;
98+ if ( style ) {
99+ let key : keyof React . CSSProperties ;
100+ for ( key in style ) {
101+ ( cellStyle as any ) [ key ] = style [ key ] ;
102+ }
103+ }
104+
96105 return (
97106 < div
98107 role = "gridcell"
@@ -103,7 +112,7 @@ function Cell<R, SR>(
103112 ref = { ref }
104113 tabIndex = { tabIndex }
105114 className = { className }
106- style = { getCellStyle ( column , colSpan ) }
115+ style = { cellStyle }
107116 onClick = { handleClick }
108117 onDoubleClick = { handleDoubleClick }
109118 onContextMenu = { handleContextMenu }
Original file line number Diff line number Diff line change @@ -145,7 +145,7 @@ export interface CellRendererProps<TRow, TSummaryRow>
145145 extends Pick < RenderRowProps < TRow , TSummaryRow > , 'row' | 'rowIdx' | 'selectCell' > ,
146146 Omit <
147147 React . HTMLAttributes < HTMLDivElement > ,
148- 'style' | ' children' | 'onClick' | 'onDoubleClick' | 'onContextMenu'
148+ 'children' | 'onClick' | 'onDoubleClick' | 'onContextMenu'
149149 > {
150150 column : CalculatedColumn < TRow , TSummaryRow > ;
151151 colSpan : number | undefined ;
You can’t perform that action at this time.
0 commit comments