Skip to content

fix(grid-lite): column field NoInfer to avoid fallback type compat issue#17250

Merged
damyanpetev merged 3 commits into
21.2.xfrom
dpetev/grid-lite-column-noinfer-21.2
May 18, 2026
Merged

fix(grid-lite): column field NoInfer to avoid fallback type compat issue#17250
damyanpetev merged 3 commits into
21.2.xfrom
dpetev/grid-lite-column-noinfer-21.2

Conversation

@damyanpetev
Copy link
Copy Markdown
Member

Closes #16962

Description

When assigning Grid Lite column field template type checker infers the column component's T from the binding, uses TypeScript's type inference to solve for T from Keys<T>. Since Keys is a complex conditional/mapped type (and kinda inferred itself), TypeScript can't reverse-infer it cleanly and lands on { [x: string]: {} }, where Keys<{ [x: string]: {} }> = string | number (no symbol). Meanwhile column.field is Keys<any> = keyof any = string | number | symbol. The symbol can't be assigned — hence the error.

The cleanest solution without narrowing the defaults is to turn off the infer on field; feels a bit odd to have the key produce the type back anyway.

Type of Change (check all that apply):

  • Bug fix
  • New functionality
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Refactoring (no functional changes)
  • Documentation
  • Demos
  • CI/CD
  • Tests
  • Changelog
  • Skills/Agents

How Has This Been Tested?

  • Unit tests Can't repro type error in current test setup, demo build should keep the error in check
  • Manual testing
  • Automated e2e tests

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
  • Accessibility (ARIA, keyboard navigation, focus management) has been verified

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR addresses an Angular template type-checking issue in Grid Lite where binding a column configuration’s field could incorrectly back-infer the column component generic T, leading to a symbol incompatibility error (as reported in #16962).

Changes:

  • Prevent TypeScript from inferring IgxGridLiteColumnComponent<T>’s T from the field input by wrapping it in NoInfer.
  • Update the Grid Lite demo sample to include both untyped and typed column configuration arrays and bind them via @for loops to validate the fix in a real template scenario.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.

File Description
projects/igniteui-angular/grids/lite/src/grid-lite-column.component.ts Applies NoInfer<Keys<T>> to the field input type to stop problematic reverse inference.
src/app/grid-lite/grid-lite.sample.ts Adds IgxGridLiteColumnConfiguration examples (untyped + User-typed) and types demo data as User[].
src/app/grid-lite/grid-lite.sample.html Switches the “age” column to be generated from configuration via @for and adds a second typed columns loop.

@Hristo313 Hristo313 added 💥 status: in-test PRs currently being tested ✅ status: verified Applies to PRs that have passed manual verification and removed ❌ status: awaiting-test PRs awaiting manual verification 💥 status: in-test PRs currently being tested labels May 18, 2026
@damyanpetev damyanpetev added the squash-merge Merge PR with "Squash and Merge" option label May 18, 2026
@damyanpetev damyanpetev merged commit 8ec94af into 21.2.x May 18, 2026
5 checks passed
@damyanpetev damyanpetev deleted the dpetev/grid-lite-column-noinfer-21.2 branch May 18, 2026 13:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

grid-lite squash-merge Merge PR with "Squash and Merge" option version: 21.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.

4 participants