Skip to content

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

Merged
dkamburov merged 17 commits intomasterfrom
mkirova/min-max-widths
Mar 26, 2025
Merged

feat(igxGrid): Apply min/max width constraints on user-set and auto-w…#15449
dkamburov merged 17 commits intomasterfrom
mkirova/min-max-widths

Conversation

@MayaKirova
Copy link
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
kdinev
kdinev previously approved these changes Mar 7, 2025
@kdinev kdinev added ❌ status: awaiting-test PRs awaiting manual verification grid version: 19.2.x labels Mar 11, 2025
@tishko0 tishko0 added ✅ status: verified Applies to PRs that have passed manual verification and removed ❌ status: awaiting-test PRs awaiting manual verification labels Mar 20, 2025
@dkamburov
Copy link
Copy Markdown
Contributor

@MayaKirova please add a note to the changelog

@dkamburov dkamburov merged commit f99e4f5 into master Mar 26, 2025
9 of 15 checks passed
@dkamburov dkamburov deleted the mkirova/min-max-widths branch March 26, 2025 08:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

grid version: 19.2.x ✅ status: verified Applies to PRs that have passed manual verification

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

5 participants