Skip to content

Apply generic types for Combo Change event. Fix silent error for Change event when using T=int. - #358

Open
skrustev wants to merge 5 commits into
masterfrom
skrastev/fix-downcast
Open

Apply generic types for Combo Change event. Fix silent error for Change event when using T=int.#358
skrustev wants to merge 5 commits into
masterfrom
skrastev/fix-downcast

Conversation

@skrustev

@skrustev skrustev commented Aug 21, 2026

Copy link
Copy Markdown
Member

Description

  • Fix binding to Combo Change event when using T="int" throwing exception silently.
  • Add ability to convert value of other related types to specific type, in this case the Combo Change event Value args with specified generic type.
  • Apply the generic types for the Combo Value in IgbComboChangeEventArgs and IgbComboChangeEventArgsDetail.
  • Refactor some Combo tests to easily test out different types for the Combo values like int/double/string.

Motivation / Context

The above items are quite critical to the normal Combo functioning in Blazor when using different value types and are some needed quality improvements.

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

Component(s) / Area(s) Affected:

Combo, Possibly Calendar

How Has This Been Tested?

  • Unit tests
  • Manual testing
  • Automated e2e tests

Test Configuration:

  • .NET version:
  • Hosting model:
  • Browser(s):
  • OS:

Screenshots / Recordings

Checklist:

  • All relevant tags have been applied to this PR
  • This PR includes unit tests covering all the new code
  • This PR includes API docs for newly added methods/properties
  • 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 behavioral changes and the feature specification has been updated with them
  • Accessibility (ARIA, keyboard navigation, focus management) has been verified

Closes #

@skrustev
skrustev requested a review from damyanpetev August 21, 2026 10:00
@skrustev skrustev added the ❌ status: awaiting-test PRs awaiting manual verification label Aug 21, 2026
Comment thread src/componentsBase/BaseRendererElement.cs Fixed
Comment thread src/componentsBase/BaseRendererElement.cs Fixed
@skrustev
skrustev marked this pull request as ready for review August 21, 2026 13:45
Copilot AI lite review requested due to automatic review settings August 21, 2026 13:45
@skrustev skrustev added the combo label Aug 21, 2026

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

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 updates the Ignite UI for Blazor Combo wrapper to strongly-type the Change event arguments using the combo’s generic type parameter, and adjusts the interop marshalling pipeline so keyed selection values can round-trip correctly (including T=int which previously failed silently).

Changes:

  • Made IgbCombo<T>.Change use EventCallback<IgbComboChangeEventArgs<T>>, with Detail.NewValue now typed as T[].
  • Updated marshalling/return-value conversion to construct generic combo event args/details and to better transform arrays before downcasting.
  • Expanded unit coverage for keyed-value scenarios across int, double, and string keys.

Reviewed changes

Copilot reviewed 7 out of 7 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
tests/IgniteUI.Blazor.Tests/ComboTests.cs Refactors keyed-value contract tests into a generic base and adds coverage for int/double/string key values.
src/componentsBase/MarshalByValueFactory.cs Adds a generic CreateInstance<T> so combo change event args/details can be created with the correct generic type.
src/componentsBase/BaseRendererElement.cs Adds generic overloads for conversion helpers and propagates generic conversion to the root control.
src/componentsBase/BaseRendererControl.cs Improves array transformation/downcast behavior and routes marshal-by-value creation through generic factory.
src/components/Blazor/ComboChangeEventArgsDetail.cs Makes NewValue strongly typed (T[]) and deserializes it via ReturnToObjectArray<T>.
src/components/Blazor/ComboChangeEventArgs.cs Makes Detail strongly typed (IgbComboChangeEventArgsDetail<T>) and converts via ConvertReturnValue<T>.
src/components/Blazor/Combo.cs Updates Change event callback type to the new generic event args and propagates typed value updates.
Suppressed comments (1)

tests/IgniteUI.Blazor.Tests/ComboTests.cs:357

  • ComboValueKeyStringTests should override the value-key name to use StringId so the test exercises the string-key path rather than still using the default "Id" key.
public class ComboValueKeyStringTests : ComboValueKeyTestsBase<string>
{
    protected override string EventKeyValue => "\"UK02\"";
    protected override string ExpectedKeyValue => "UK02";
    protected override string[] PropValues => ["UK01", "UK03"];
    protected override string ExpectedValue => """["UK01", "UK03"]""";

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread tests/IgniteUI.Blazor.Tests/ComboTests.cs Outdated
Comment thread tests/IgniteUI.Blazor.Tests/ComboTests.cs Outdated
Comment thread src/componentsBase/BaseRendererControl.cs
Comment thread src/componentsBase/BaseRendererControl.cs Outdated
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

combo ❌ status: awaiting-test PRs awaiting manual verification

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants