diff --git a/examples/Demo/Shared/Microsoft.FluentUI.AspNetCore.Components.xml b/examples/Demo/Shared/Microsoft.FluentUI.AspNetCore.Components.xml index 7a9baedcc7..7e9ed2f07b 100644 --- a/examples/Demo/Shared/Microsoft.FluentUI.AspNetCore.Components.xml +++ b/examples/Demo/Shared/Microsoft.FluentUI.AspNetCore.Components.xml @@ -8084,7 +8084,7 @@ - Gets context for this . + Gets context for this . @@ -8137,7 +8137,7 @@ Gets or sets the content to be rendered inside the component. - + diff --git a/src/Core/Components/List/FluentSelect.razor.cs b/src/Core/Components/List/FluentSelect.razor.cs index 9d4cae555b..594d312182 100644 --- a/src/Core/Components/List/FluentSelect.razor.cs +++ b/src/Core/Components/List/FluentSelect.razor.cs @@ -47,7 +47,9 @@ public partial class FluentSelect : ListComponentBase where TO private string? GetAriaLabelWithRequired() { +#pragma warning disable CS0618 // Type or member is obsolete var label = AriaLabel ?? Label ?? Title ?? string.Empty; +#pragma warning restore CS0618 // Type or member is obsolete return label + (Required ? $", {RequiredAriaLabel}" : string.Empty); } diff --git a/src/Core/Components/Radio/FluentRadio.razor.cs b/src/Core/Components/Radio/FluentRadio.razor.cs index d1c64ab648..a574120024 100644 --- a/src/Core/Components/Radio/FluentRadio.razor.cs +++ b/src/Core/Components/Radio/FluentRadio.razor.cs @@ -6,7 +6,7 @@ namespace Microsoft.FluentUI.AspNetCore.Components; public partial class FluentRadio<[DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.All)] TValue> : FluentComponentBase { /// - /// Gets context for this . + /// Gets context for this . /// internal FluentRadioContext? Context { get; private set; } @@ -78,7 +78,7 @@ public FluentRadio() } /// - protected override void OnInitialized() + protected override void OnParametersSet() { Context = string.IsNullOrEmpty(Name) ? CascadedContext : CascadedContext?.FindContextInAncestors(Name); diff --git a/src/Core/Components/Radio/FluentRadioGroup.razor b/src/Core/Components/Radio/FluentRadioGroup.razor index edeb3c59bf..94fd4d4aa7 100644 --- a/src/Core/Components/Radio/FluentRadioGroup.razor +++ b/src/Core/Components/Radio/FluentRadioGroup.razor @@ -12,6 +12,7 @@ name="@_context!.GroupName" orientation="@Orientation.ToAttributeValue()" required="@Required" + value="@CurrentValueAsString" @onradiogroupchange="HandleChange" @attributes="AdditionalAttributes"> @ChildContent diff --git a/src/Core/Components/Radio/FluentRadioGroup.razor.cs b/src/Core/Components/Radio/FluentRadioGroup.razor.cs index fce0912924..e7eb280777 100644 --- a/src/Core/Components/Radio/FluentRadioGroup.razor.cs +++ b/src/Core/Components/Radio/FluentRadioGroup.razor.cs @@ -49,7 +49,7 @@ protected override void OnParametersSet() else if (_context.ParentContext != CascadedContext) { // This should never be possible in any known usage pattern, but if it happens, we want to know - throw new InvalidOperationException("An FluentRadioGroup cannot change context after creation"); + throw new InvalidOperationException("A FluentRadioGroup cannot change context after creation"); } // Mutate the FluentRadioContext instance in place. Since this is a non-fixed cascading parameter, the descendant @@ -65,7 +65,7 @@ protected override bool TryParseValueFromString(string? value, [MaybeNullWhen(fa private void HandleChange(ChangeEventArgs e) { - if (CurrentValueAsString != e?.Value?.ToString()) + if (CurrentValueAsString != e?.Value?.ToString() && e?.Value is not null) { CurrentValueAsString = e?.Value?.ToString(); } diff --git a/tests/Core/_ToDo/Radio/FluentRadioGroupTests.FluentRadioGroup_Default.verified.html b/tests/Core/_ToDo/Radio/FluentRadioGroupTests.FluentRadioGroup_Default.verified.html index 425f432171..3b8d393170 100644 --- a/tests/Core/_ToDo/Radio/FluentRadioGroupTests.FluentRadioGroup_Default.verified.html +++ b/tests/Core/_ToDo/Radio/FluentRadioGroupTests.FluentRadioGroup_Default.verified.html @@ -1,4 +1,4 @@ - + render me