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

column width not working on 1.69.2

Open freewheel70 opened this issue 6 years ago • 5 comments

column width not working on 1.69.2

const columns = [
  {
    title: 'Name',
    field: 'name'
  },
  {
    title: 'Description',
    field: 'description',
  },
  {
    title: 'Version',
    field: 'version',
    width: 80
  }]

...

<MaterialTable
            columns={columns}
            data={data}
            options={{
              filtering: true,
              showTitle: false,
              search: false,
              toolbar: false,
              draggable: false
            }}
        />

the table cell for version is not fixed to 80px but share the same width of the other columns.

It is probably a bug of the new code change in https://github.com/mbrn/material-table/blob/b7474ca0f5497f04ff3a3d50e709d86de7c639b0/src/utils/data-manager.js#L64.

    const undefinedWidthColumns = columns.filter((c) =>
      c.width === undefined && c.columnDef
        ? c.columnDef.tableData.width === undefined
        : true && !c.hidden
    );

And BTW, IMO the new code is hard to read, please refactor to be more readable and maintainable.

freewheel70 avatar Dec 04 '20 04:12 freewheel70

I can confirm that. My table clomuns are now stretching like crazy.

proutek avatar Dec 04 '20 17:12 proutek

@proutek rollback to 1.69.0 works for me

freewheel70 avatar Dec 05 '20 02:12 freewheel70

I think its related to / duplicated by https://github.com/mbrn/material-table/issues/2643

Samurus avatar Dec 11 '20 09:12 Samurus

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 Mar 11 '21 21:03 stale[bot]

Hi, the bug is still present in 1.69.3

HugoBaspin avatar Jun 24 '21 09:06 HugoBaspin