material-table icon indicating copy to clipboard operation
material-table copied to clipboard

Aligning detail panel column on right side causes filters columns to misalign

Open eclafelix opened this issue 6 years ago • 6 comments

Bug When detailPanelColumnAlignment is set to right it causes filter columns to shift and move one column to the right on render.

To Reproduce Set 'detailPanelColumnAlignment' to 'right and 'filtering' to 'true' in options

Expected behavior The columns of the filter row should be aligned with their respective field column

Screenshots Screenshot_2020-01-17 Eclipse Mining

Desktop

  • OS: Windows
  • Browser Firefox
  • Version 72.0.1

eclafelix avatar Jan 17 '20 16:01 eclafelix

Looks like the issue stems from m-table-filter-row.js there is no index prop being used so it is moving the filters as if detail panel is still at the start of the array. MUI_filter

eclafelix avatar Jan 20 '20 15:01 eclafelix

Any update or a workaround on this?

Thanks!

dyaacov avatar May 08 '20 07:05 dyaacov

The fix for me was really easy, I just changed the index of the splice in m-table-filter-row to columns.length on line 269:

if (this.props.hasDetailPanel) { columns.splice(columns.length, 0, React.createElement(_TableCell["default"], { padding: "none", key: "key-detail-panel-column" })); }

eclafelix avatar May 13 '20 14:05 eclafelix

I'm facing the same issue. @eclafelix Are you working on this issue or can I put in a fix for this?

sujay-gandham-by avatar Aug 09 '20 04:08 sujay-gandham-by

Hi Sujay,

No, I'm not on it. I'll appreciate it if you share your fix when ready.

Thanks!

On Sun, Aug 9, 2020 at 7:58 AM Sujay Gandham [email protected] wrote:

I'm facing the same issue. @eclafelix https://github.com/eclafelix Are you working on this issue or can I put in a fix for this?

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/mbrn/material-table/issues/1538#issuecomment-671006549, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAZ3NNBBNRMMVBDG6AULGF3R7YUJFANCNFSM4KIKRW7A .

dyaacov avatar Aug 09 '20 06:08 dyaacov

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.

stale[bot] avatar Nov 07 '20 08:11 stale[bot]