React-table: Column widths are allowed to go below the minWidth.

Created on 6 Oct 2017  路  2Comments  路  Source: tannerlinsley/react-table

What version of React-Table are you using?

[email protected]

What bug are you experiencing, or what feature are you proposing?

Resizable columns seem to be able to go below the set minWidth.

Use https://codesandbox.io/s/X6npLXPRW (by clicking the "Fork" button) to reproduce the issue.

https://codesandbox.io/s/2wqm2wm89y
First Name column has minWidth set to 150, but the column width can go well below that when resizing.

What are the steps to reproduce the issue?

  1. Set minWidth on column to 150.
  2. Try to resize the column as small as possible and you will see that it goes below the minWidth of 150.

All 2 comments

I can confirm that the resizing of a column does not respect minWidth (there is no checking in the code so the assumption is that no restriction was ever intended). However, the documentation refers to minWidth as relating to the setting of flex (i.e. controlling how small the flexbox can be) rather than controlling what a user can size the column to.

I think both functions have validity. Firstly, ensuring that automatic sizing can't exceed constraints and secondly, allowing a user to override any "restricted" nature of columns (as you can never be certain what the usage of the page looks like and what other parts of the table they are trying to see).

So, at this point, I'd say it is behaving as designed and to be able to restrict the resizer would be a Feature Request. Something like a minResizerWidth prop on the column.

Closing as the behaviour of #react-table is considered to be as expected and documented.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

Abdul-Hameed001 picture Abdul-Hameed001  路  3Comments

ocalde picture ocalde  路  3Comments

DaveyEdwards picture DaveyEdwards  路  3Comments

LeonHex picture LeonHex  路  3Comments

mellis481 picture mellis481  路  3Comments