File tree Expand file tree Collapse file tree 4 files changed +9
-12
lines changed
packages/material-react-table Expand file tree Collapse file tree 4 files changed +9
-12
lines changed Original file line number Diff line number Diff line change @@ -311,10 +311,7 @@ export const MRT_TableBodyCell = <TData extends MRT_RowData>({
311311 table,
312312 } )
313313 ) : isCreating || isEditing ? (
314- < MRT_EditCellTextField
315- cell = { cell }
316- table = { table }
317- />
314+ < MRT_EditCellTextField cell = { cell } table = { table } />
318315 ) : showClickToCopyButton && columnDef . enableClickToCopy !== false ? (
319316 < MRT_CopyButton cell = { cell } table = { table } >
320317 < MRT_TableBodyCellValue { ...cellValueProps } />
Original file line number Diff line number Diff line change @@ -94,7 +94,11 @@ export const MRT_ToggleRowActionMenuButton = <TData extends MRT_RowData>({
9494 < EditIcon />
9595 </ IconButton >
9696 </ Tooltip >
97- ) : renderRowActionMenuItems ? (
97+ ) : renderRowActionMenuItems ?.( {
98+ row,
99+ staticRowIndex,
100+ table,
101+ } as any ) ?. length ? (
98102 < >
99103 < Tooltip { ...getCommonTooltipProps ( ) } title = { localization . rowActions } >
100104 < IconButton
Original file line number Diff line number Diff line change @@ -1239,7 +1239,7 @@ export interface MRT_TableOptions<TData extends MRT_RowData>
12391239 row : MRT_Row < TData > ;
12401240 staticRowIndex ?: number ;
12411241 table : MRT_TableInstance < TData > ;
1242- } ) => ReactNode [ ] ;
1242+ } ) => ReactNode [ ] | undefined ;
12431243 renderRowActions ?: ( props : {
12441244 cell : MRT_Cell < TData > ;
12451245 row : MRT_Row < TData > ;
Original file line number Diff line number Diff line change @@ -128,15 +128,14 @@ export const RowActionsEnabledConditionally = () => {
128128} ;
129129
130130export const RowActionsEnabledConditionallyPerRow = ( ) => {
131- const [ enabled , setEnabled ] = useState ( false ) ;
132131 return (
133132 < MaterialReactTable
134133 columns = { columns }
135134 data = { data }
136- enableRowActions = { enabled }
135+ enableRowActions
137136 renderRowActionMenuItems = { ( { closeMenu, row } ) =>
138137 row . index % 2 === 0
139- ? [ ]
138+ ? undefined
140139 : [
141140 < MenuItem
142141 key = { 1 }
@@ -167,9 +166,6 @@ export const RowActionsEnabledConditionallyPerRow = () => {
167166 </ MenuItem > ,
168167 ]
169168 }
170- renderTopToolbarCustomActions = { ( ) => (
171- < Button onClick = { ( ) => setEnabled ( ! enabled ) } > Toggle Row Actions</ Button >
172- ) }
173169 />
174170 ) ;
175171} ;
You can’t perform that action at this time.
0 commit comments