Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[grid] Provide minWidth and maxWidth properties for Grid's column #6669

Open
glebfox opened this issue Oct 18, 2023 · 7 comments
Open

[grid] Provide minWidth and maxWidth properties for Grid's column #6669

glebfox opened this issue Oct 18, 2023 · 7 comments
Labels
enhancement New feature or request vaadin-grid

Comments

@glebfox
Copy link

glebfox commented Oct 18, 2023

Describe your motivation

Currently it is not possible to set the boundaries of column resizing. At least min width is very important if a column can be resized.

Describe the solution you'd like

Grid's column has minWidth/maxWidth properties that are set to corresponding header and body elements (similar to width, flexGrow, etc.) and taken into account by ColumnResizingMixin.

Describe alternatives you've considered

No response

Additional context

No response

@web-padawan web-padawan added enhancement New feature or request vaadin-grid labels Oct 18, 2023
@tomivirkki
Copy link
Member

tomivirkki commented Oct 25, 2023

Same as #5940

@glebfox
Copy link
Author

glebfox commented Oct 25, 2023

Same as #5940

Hi, not exactly the same. I personally more interested in minWidth property that is taken into account by resizer. The linked issue refers to the maxWidth only.

@rolfsmeds
Copy link
Contributor

@glebfox can you describe a use case for the maxwidth part? In what situations would you want to limit how wide the end user can make a column?

@knoobie
Copy link
Contributor

knoobie commented Mar 21, 2024

For me it's not about the user who enlarges the grid column, but the grid itself creating columns that have at least 50px, but it can grow up to 300px with wider content; content that is larger than that gets clipped / ellipsed.

@glebfox
Copy link
Author

glebfox commented Mar 21, 2024

@rolfsmeds as I mentioned above, I personally more interested in minWidth property that is taken into account by resizer. I've created more generic issue because minWidth and maxWidth looks like related properties for me, so someone may be interested in maxWidth either. In terms of maxWidth, I agree with @knoobie that limiting the max width can be suitable in case of too looooong values so we prevent Grid from creating too wide columns.

@rolfsmeds
Copy link
Contributor

Right, I suppose if we had minWidth and maxWidth properties for columns, it would be logical for them to affect both user resizing and autoWidth and flexGrow.

(Of course for flexGrow the width itself already functions as a minWidth, so in that case only maxWidth would have any effect, but for autoWidth both would be useful.)

@rolfsmeds
Copy link
Contributor

Acceptance Criteria: vaadin/platform#6553

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request vaadin-grid
Projects
None yet
Development

No branches or pull requests

5 participants