Align component property defaults with the web components, unit & integration checks - #292
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This pull request aligns Ignite UI for Blazor wrapper property backing-field initializers with the actual default values used by the underlying Ignite UI Web Components, so reading an unassigned [Parameter] reflects the rendered component’s effective default. It also adds unit and integration checks to prevent future drift between wrapper defaults and web component defaults.
Changes:
- Updated backing-field initializers for 27 wrapper properties so getters report upstream defaults instead of C# type defaults.
- Added per-component unit tests asserting wrapper default values match the web component defaults.
- Added an integration “default values” sweep in the Lite TestBed (with per-component exclusions for derived client-side defaults).
Reviewed changes
Copilot reviewed 43 out of 43 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| tests/IgniteUI.Blazor.Tests/TooltipTests.cs | Adds a unit test asserting IgbTooltip default values match the web component. |
| tests/IgniteUI.Blazor.Tests/ToastTests.cs | Adds a unit test asserting IgbToast.DisplayTime default matches the web component. |
| tests/IgniteUI.Blazor.Tests/TileManagerTests.cs | Adds a unit test asserting IgbTile default values match the web component. |
| tests/IgniteUI.Blazor.Tests/ThemeProviderTests.cs | Unskips/updates the default-values test to validate Bootstrap as the default theme. |
| tests/IgniteUI.Blazor.Tests/TextareaTests.cs | Adds a unit test asserting IgbTextarea defaults (rows/spellcheck) match the web component. |
| tests/IgniteUI.Blazor.Tests/StepperTests.cs | Adds a unit test asserting IgbStepper.AnimationDuration default matches the web component. |
| tests/IgniteUI.Blazor.Tests/SnackbarTests.cs | Adds a unit test asserting IgbSnackbar.DisplayTime default matches the web component. |
| tests/IgniteUI.Blazor.Tests/SliderTests.cs | Adds a unit test asserting IgbSlider defaults (max/step) match the web component. |
| tests/IgniteUI.Blazor.Tests/SelectTests.cs | Adds a unit test asserting IgbSelect.Placement default matches the web component. |
| tests/IgniteUI.Blazor.Tests/RatingTests.cs | Adds a unit test asserting IgbRating defaults (max/step) match the web component. |
| tests/IgniteUI.Blazor.Tests/RangeSliderTests.cs | Adds a unit test asserting IgbRangeSlider defaults (max/step) match the web component. |
| tests/IgniteUI.Blazor.Tests/RadioTests.cs | Adds a unit test asserting IgbRadioGroup.Alignment default matches the web component. |
| tests/IgniteUI.Blazor.Tests/LinearProgressTests.cs | Adds a unit test asserting IgbLinearProgress defaults (max/animation duration) match the web component. |
| tests/IgniteUI.Blazor.Tests/DropdownTests.cs | Adds a unit test asserting IgbDropdown.Placement default matches the web component. |
| tests/IgniteUI.Blazor.Tests/DateTimeInputTests.cs | Adds a unit test asserting IgbDateTimeInput.SpinLoop default matches the web component. |
| tests/IgniteUI.Blazor.Tests/DateRangePickerTests.cs | Adds a unit test asserting IgbDateRangePicker.VisibleMonths default matches the web component. |
| tests/IgniteUI.Blazor.Tests/DatePickerTests.cs | Adds a unit test asserting IgbDatePicker.VisibleMonths default matches the web component. |
| tests/IgniteUI.Blazor.Tests/CircularProgressTests.cs | Adds a unit test asserting IgbCircularProgress defaults (max/animation duration) match the web component. |
| tests/IgniteUI.Blazor.Tests/CircularGradientTests.cs | Adds a unit test asserting IgbCircularGradient.Opacity default matches the web component. |
| tests/IgniteUI.Blazor.Tests/CarouselTests.cs | Adds a unit test asserting IgbCarousel.MaximumIndicatorsCount default matches the web component. |
| tests/IgniteUI.Blazor.Tests/CalendarTests.cs | Adds a unit test asserting IgbCalendar.VisibleMonths default matches the web component. |
| tests/IgniteUI.Blazor.Lite.TestBed/componentsConfig.json | Adds ExcludedDefaultProps entries to exclude derived client-side defaults (UpperBound/LowerBound) from default comparison. |
| tests/IgniteUI.Blazor.Lite.TestBed/Components/Pages/Home.razor | Adds a TestPropDefaults integration sweep and wires per-component excluded-default configuration. |
| tests/IgniteUI.Blazor.Lite.TestBed/Components/Common/TestUtil.cs | Adds HasComparableDefault helper to scope default comparisons to comparable primitive/enum types. |
| tests/IgniteUI.Blazor.Lite.TestBed/Components/Common/ReflectionUtils.cs | Adds excludedDefaultProps storage used by the integration default-values sweep. |
| src/components/Blazor/Tooltip.cs | Updates tooltip defaults (Offset, Placement, ShowDelay, HideDelay) to match web component behavior. |
| src/components/Blazor/Tile.cs | Updates tile defaults (ColSpan, RowSpan, Position) to match web component behavior. |
| src/components/Blazor/ThemeProvider.cs | Updates theme provider default theme to Bootstrap. |
| src/components/Blazor/Textarea.cs | Updates textarea defaults (Rows, Spellcheck) to match web component behavior. |
| src/components/Blazor/Stepper.cs | Updates stepper default AnimationDuration to match web component behavior. |
| src/components/Blazor/SliderBase.cs | Updates slider base defaults (Max, Step) to match web component behavior. |
| src/components/Blazor/Select.cs | Updates select default Placement to match web component behavior. |
| src/components/Blazor/Rating.cs | Updates rating defaults (Max, Step) to match web component behavior. |
| src/components/Blazor/RadioGroup.cs | Updates radio group default Alignment to match web component behavior. |
| src/components/Blazor/ProgressBase.cs | Updates progress defaults (Max, AnimationDuration) to match web component behavior. |
| src/components/Blazor/Dropdown.cs | Updates dropdown default Placement to match web component behavior. |
| src/components/Blazor/DateTimeInputBase.cs | Updates date-time input base default SpinLoop to match web component behavior. |
| src/components/Blazor/DateRangePicker.cs | Updates date range picker default VisibleMonths to match web component behavior. |
| src/components/Blazor/DatePicker.cs | Updates date picker default VisibleMonths to match web component behavior. |
| src/components/Blazor/CircularGradient.cs | Updates circular gradient default Opacity to match web component behavior. |
| src/components/Blazor/Carousel.cs | Updates carousel default MaximumIndicatorsCount to match web component behavior. |
| src/components/Blazor/Calendar.cs | Updates calendar default VisibleMonths to match web component behavior. |
| src/components/Blazor/BaseAlertLike.cs | Updates alert-like default DisplayTime to match web component behavior. |
MayaKirova
approved these changes
Aug 6, 2026
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.
Discovered in #286
The backing fields for 27 wrapper properties were initialized to the C# type default —
0,false, or the first enum member — instead of the default the underlying web component actually starts with. Reading such a property before assigning it reported a value the component never used:Tooltip.ShowDelayreturned0while the tooltip actually waited 200ms, andTooltip.PlacementreturnedTopwhile the popover opened at the bottom.Why it matters
Rendering was never wrong. A property is serialized only when it has been marked dirty, and
_isDirtyis set exclusively byMarkPropDirty/OnRefChangedwith no bulk-serialize path, so an unassigned property is never sent to the client and the component keeps applying its own default.The problem is on the read side. The getter returns the backing field, so any code that inspects a property it has not set — a conditional, a computed value, a variable bound to it — sees a number or enum member that does not describe the rendered component. None of these properties expose a
Get<Prop>()/Get<Prop>Async()accessor either, so there was no way to obtain the effective value from .NET.The enum cases are the most likely to cause real trouble:
PlacementonIgbDropdown,IgbSelectandIgbTooltip, andThemeonIgbThemeProvider.Changes
BaseAlertLike.DisplayTime04000Calendar.VisibleMonths01DateRangePicker.VisibleMonths02Carousel.MaximumIndicatorsCount010CircularGradient.Opacity01DatePicker.VisibleMonths01DateTimeInputBase.SpinLoopfalsetrueDropdown.PlacementTopBottomStartProgressBase.Max0100ProgressBase.AnimationDuration0500RadioGroup.AlignmentHorizontalVerticalRating.Max05Rating.Step01Select.PlacementTopBottomStartSliderBase.Max0100SliderBase.Step01Stepper.AnimationDuration0320Textarea.Rows03Textarea.SpellcheckfalsetrueThemeProvider.ThemeMaterialBootstrapTile.ColSpan01Tile.RowSpan01Tile.Position0-1Tooltip.Offset06Tooltip.PlacementTopBottomTooltip.ShowDelay0200Tooltip.HideDelay0300One line per property; no other production code touched.
Most defaults were taken from
custom-elements.json, with the enum ones resolved through each member's[WCEnumName]attribute rather than by name — that is what mapsbottom-starttoBottomStart. It also showsSliderTickLabelRotation.Zerois not a mismatch despite looking like one: its[WCEnumName("0")]already equals upstream's0, so it is left as is.The last four —
DateRangePicker.VisibleMonths,SliderBase.Max,SliderBase.StepandTile.Position— are not in the manifest at all. Upstream implements those members as accessors rather than plain fields, so the metadata records no default and only the running component knows the value (_visibleMonths = 2,_max = 100,_step = 1,_position = -1). They were found by the integration check described below, which is the argument for having it.Deliberately not changed
Slider/RangeSliderUpperBoundalso reports100on the client, but it is derived rather than stored:Pinning the wrapper to
100would be wrong the momentMaxis set to anything else. It andLowerBound(derived fromminthe same way, and equal only by coincidence today) are listed inExcludedDefaultPropsinstead, with the reason recorded in the config.Test coverage
Both directions are now pinned, so this cannot silently regress:
..._DefaultValues_MatchWebComponentcheck.ThemeProviderTestsalready had one, written and skipped with the note "Default should be Bootstrap"; it is un-skipped here.TestPropDefaultsin the TestBed runs before any property is assigned and compares every comparable property against the value the real component starts with. It is the reverse of the existingTestPropssweep, which only proves that values written from .NET reach the client, and is what surfaced the four accessor-backed defaults. Scoped to booleans, numbers and enums, since strings, objects and dates are left null by the wrapper while the client reports''or undefined.Behavior after the change
ShowDelay = 0marks the property dirty because200 != 0.!IsPropDirtyarm of the setter.Verification
dotnet buildclean; unit suite 902 passed, 0 failed; integration suite 71 passed, 0 failed. The pre-existing assertions on these properties all follow an explicit assignment, so none depended on the old initial values.Both checks were confirmed to actually fail on a regression: reverting
Tooltip.ShowDelayto0fails the unit check, and the integration sweep reports it as "Default value mismatch before setting. Prop name: ShowDelay. The wrapper reports:0, but the client component starts with: 200".