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

Min width not work with headerStyle.

Open kirin-yuen opened this issue 5 years ago • 4 comments

Describe the bug minHeight work with header style, but minWidth doesn't.

To Reproduce Steps to reproduce the behavior:

  1. Visit https://codesandbox.io/s/frosty-sound-xbjmx?file=/src/App.js
  2. Please press F12 to open dev tool and inspect target element to see the style, minWidth not apply but minHeight do

Expected behavior A clear and concise description of what you expected to happen.

Screenshots image

kirin-yuen avatar Aug 12 '21 05:08 kirin-yuen

This is poorly documented, but if you look at the source, it seems minWidth / maxWidth are properties of Column, not headerStyle. So it should go directly in your column object (next to field, title) like this:

{
  title: "one",
  field: "one",
  minWidth: "90px",
  headerStyle: {
    minHeight: "120px"
  }
}

chris-jalon avatar Aug 17 '21 18:08 chris-jalon

This is poorly documented, but if you look at the source, it seems minWidth / maxWidth are properties of Column, not headerStyle. So it should go directly in your column object (next to field, title) like this:

{
  title: "one",
  field: "one",
  minWidth: "90px",
  headerStyle: {
    minHeight: "120px"
  }
}

I found that not work for me, the column will have style width with calc(xxxx), image

kirin-yuen avatar Aug 18 '21 02:08 kirin-yuen

@kirin-yuen It does seem unstable still, yes... Look at my example here: https://codesandbox.io/s/cool-cohen-bif21?file=/src/App.js it appears to be working. Try switching the order, using 90 instead of "90px", etc.

chris-jalon avatar Aug 18 '21 16:08 chris-jalon

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