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
Open
Apply generic types for Combo Change event. Fix silent error for Change event when using T=int.#358skrustev wants to merge 5 commits into
skrustev wants to merge 5 commits into
Conversation
Contributor
There was a problem hiding this comment.
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>.ChangeuseEventCallback<IgbComboChangeEventArgs<T>>, withDetail.NewValuenow typed asT[]. - 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, andstringkeys.
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
ComboValueKeyStringTestsshould override the value-key name to useStringIdso 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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Changeevent when usingT="int"throwing exception silently.Valueargs with specified generic type.IgbComboChangeEventArgsandIgbComboChangeEventArgsDetail.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):
Component(s) / Area(s) Affected:
Combo, Possibly Calendar
How Has This Been Tested?
Test Configuration:
Screenshots / Recordings
Checklist:
README.MDCHANGELOG.MDupdates for newly added functionalityCloses #