Skip to content

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

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

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

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 a Grid Lite template type-checking inference issue where binding column.field could cause TypeScript to infer an incorrect fallback model type, leading to symbol incompatibility errors.

Changes:

  • Updated IgxGridLiteColumnComponent.field input type to use NoInfer<Keys<T>> to prevent reverse-inference of T from the field binding.
  • Updated the Grid Lite sample to demonstrate both untyped and typed IgxGridLiteColumnConfiguration usage with dynamic column rendering via @for.
  • Typed the sample data as User[] to align with the sample data service model.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.

File Description
src/app/grid-lite/grid-lite.sample.ts Updates the sample to use IgxGridLiteColumnConfiguration arrays (typed and untyped) and types the data as User[].
src/app/grid-lite/grid-lite.sample.html Replaces the hard-coded age column with @for-rendered columns from the sample configuration arrays.
projects/igniteui-angular/grids/lite/src/grid-lite-column.component.ts Prevents generic type inference from the field input by wrapping Keys<T> in NoInfer.

Comment thread src/app/grid-lite/grid-lite.sample.ts Outdated
@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 7b84eb9 into master May 18, 2026
6 checks passed
@damyanpetev damyanpetev deleted the dpetev/grid-lite-column-noinfer branch May 18, 2026 13:52
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: 22.0.x ✅ status: verified Applies to PRs that have passed manual verification

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Grid Lite] IgxGridLiteColumnConfiguration requires explicit generic type and cannot be inferred

4 participants