Hiden sorting lable in the actions header
Problem: I found that there is a hiden sorting lable lies within the acitions header and can not be removed. In most cases, it's fine, but it prevents me from properly aligning (especially aligning centrally) the contents of the action column, which is a problem to me.
Solution: In the m-table-header.js, the actions header is rendered by
key: "renderActionsHeader",
value: function renderActionsHeader() {
var localization = (0, _objectSpread2["default"])({}, MTableHeader.defaultProps.localization, this.props.localization);
return React.createElement(_core.TableCell, {
key: "key-actions-column",
padding: "checkbox",
className: this.props.classes.header,
style: (0, _objectSpread2["default"])({}, this.props.headerStyle, {
textAlign: 'center'
})
}, React.createElement(_core.TableSortLabel, {
disabled: true
}, localization.actions));
}
This problem could be temporarily solved by replacing the React.createElement(_core.TableSortLabel, {disabled: true}, localization.actions) with React.createElement('div', null, localization.actions).
For a long term solution, I hope this hiden sorting label could be removed permanently or optionally in the future.
Thank you for your great work on this useful project.
Hi @GachaSalt
I will consider this. Thanks for your clear description.
@GachaSalt did you find any work arounds for this? I am facing the same alignment problems as you.
@mbrn any updates? There's a prop called hideSortIcon that you can add to TableSortLabel and it will hide the icon until sort is active. https://v3.material-ui.com/api/table-sort-label/#tablesortlabel-api
@buhrenduh I'm facing the same issue. Did you manage to find a workaround?
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. You can reopen it if it required.