web-components
web-components copied to clipboard
[grid] Make auto width default
Describe your motivation
Auto-width (based on content) is the most common desired width for Grid columns, so it would make sense to have it as the default.
Describe the solution you'd like
Make auto-width the defaut column width in Grid (as well as GridPro and CRUD).
Additional context
This is of course a breaking change, but it will hardly be disruptive in any application, as a Grid with default widths probably doesn't make any assumptions about col widths, and cases where col width is important the default has probably already been changed. Thus minimal negative effect on existing apps.
Note, this could be conflicting with https://github.com/vaadin/platform/issues/2046 in terms of affecting vaadin-grid
performance.
First step would be to test performance with auto-width on all cols, and see how much of a hit that causes.
If it's within acceptable levels, I think this would be a better out-of-the-box experience than the current 100px hardcoded default.
It turns out that auto-width actually has a significant impact on performance that we are currently unable to mitigate. Decided not to do this for the time being.
If we can't make it default, I would at least like to have a simple API for setting each column to automatic width. Something like:
<Grid autoWidth>
grid.setAutoWidth(true)