[Suggestion] ability to set the Column's width prop to "auto" or "content"
See original GitHub issueI am using the Table component with two columns. Right now the width
prop of the Column component appears to be mapped to the css flex-basis
property so it basically sets the initial width of the column which can change depending on the flexGrow
and flexShrink
.
I wish I could use auto
or content
for the width
prop of the Column component and not only number values since these are valid values for the flex-basis
property.
In my case, I want the left column to grow as much as possible without overlapping the right column which default size I cannot guess since it depends on localized text.
Setting the flex-basis
property to auto
gives me the exact behavior I want but since the width
’s prop must be a number there’s no way I can set it without this ugly css:
.myColumn{
flex-basis: auto !important;
}
Suggestion: accept ‘auto’ and ‘content’ as well as numbers for the Column’s width
prop.
Example:
<Table>
....
<Column
dataKey="name"
label="Name"
cellRenderer={this.nameRenderer}
width="auto"
flexGrow={1}
/>
...
</Table>
Which versions of React and react-virtualized, and which browser / OS are affected by this issue? Did this work in previous versions of react-virtualized?
Browser | Chrome 72 |
OS | macOS mojave |
React | 16.5.2 |
React DOM | 16.5.2 |
react-virtualized | 9.21.0 |
Issue Analytics
- State:
- Created 5 years ago
- Reactions:5
- Comments:9
Top GitHub Comments
Check out the PR please.
width
and assigns auto toflex-basis
by default;width
.It’s 2021, is this something that will be added? This would be very nice to have.