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

feat(igxGrid): Apply min/max width constraints on user-set and auto-w… #15449

Open
wants to merge 9 commits into
base: master
Choose a base branch
from

Conversation

MayaKirova
Copy link
Contributor

…idths.

Closes #15383

Additional information (check all that apply):

  • Bug fix
  • New functionality
  • Documentation
  • Demos
  • CI/CD

Checklist:

  • All relevant tags have been applied to this PR
  • This PR includes unit tests covering all the new code (test guidelines)
  • This PR includes API docs for newly added methods/properties (api docs guidelines)
  • This PR includes feature/README.MD updates for the feature docs
  • This PR includes general feature table updates in the root README.MD
  • This PR includes CHANGELOG.MD updates for newly added functionality
  • This PR contains breaking changes
  • This PR includes ng update migrations for the breaking changes (migrations guidelines)
  • This PR includes behavioral changes and the feature specification has been updated with them

@MayaKirova MayaKirova requested a review from dkamburov March 4, 2025 14:13
@MayaKirova
Copy link
Contributor Author

@ChronosSF @dkamburov @damyanpetev @kdinev

A question arose around one of the existing tests:
https://www.infragistics.com/products/ignite-ui-angular/angular/components/grid/column-resizing

In that test the scenario is the following:

<igx-column [field]="'ID'" [width]="'50px'" [header]="'ID'" [filterable]="true"></igx-column>

Small width, no user set min-width. Previously this allowed the user to set such a width initially. Resulting in a column with 50px width.

However for user interaction, there's a defaultMinWidth, based on the current density:
https://github.com/IgniteUI/igniteui-angular/blob/master/projects/igniteui-angular/src/lib/grids/columns/column.component.ts#L1185
Which gets applied by default if there's no user set min-width. Hence you cannot resize a column below that threshold.

For instance, here: https://www.infragistics.com/products/ignite-ui-angular/angular/components/grid/column-resizing#angular-grid-column-resizing-example
First column has no min-width, but resizing is still constrained to 80px (the defaultMinWidth for that density).

I believe these defaults had something to do with the different paddings in the cells, which are different for the different densities. Since below a certain threshold with the paddings you can no longer see the content of the cell and it's no longer a meaningful render. @simeonoff might have more insight.

So the question is: Should this defaultMinWidth be applied as constraint to the initially set width of the column or not?

If it does, this might be a breaking change, since user that have set a small width initially, with no min-width, will render the column with default min instead. For example, user has set 50px width, but since defaultMinWidth is 80, the column will be 80px when rendered.

Let me know what you think.

@kdinev
Copy link
Member

kdinev commented Mar 6, 2025

I don't think this defaultMinWidth should be applied in this scenario, but I'll let others comment. Currently if width is set in % and the width is smaller than this defaultMinWidth, then it doesn't get applied.

@MayaKirova MayaKirova requested a review from damyanpetev March 7, 2025 13:40
@MayaKirova MayaKirova marked this pull request as ready for review March 7, 2025 13:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

The minWidth property of the columns is not working on inital render of the grid
4 participants