Skip to content

Commit 1a926fb

Browse files
author
Domino987
committed
fix for action columns display
1 parent f4accfe commit 1a926fb

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

src/material-table.js

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -419,6 +419,19 @@ export default class MaterialTable extends React.Component {
419419
}
420420
});
421421
}
422+
// If only bulk update and add row are used, the columns do not align with the action column, because no action column is present for the add
423+
if (
424+
this.state?.showAddRow &&
425+
calculatedProps.editable.onRowAdd &&
426+
calculatedProps.actions.filter((action) => action.position === 'row')
427+
.length === 0
428+
) {
429+
calculatedProps.actions.push({
430+
icon: 'div',
431+
position: 'row',
432+
onClick: () => {}
433+
});
434+
}
422435
}
423436

424437
return calculatedProps;

0 commit comments

Comments
 (0)