diff --git a/src/BootstrapBlazor/BootstrapBlazor.csproj b/src/BootstrapBlazor/BootstrapBlazor.csproj index 0b15ff36cb7..066a96ef890 100644 --- a/src/BootstrapBlazor/BootstrapBlazor.csproj +++ b/src/BootstrapBlazor/BootstrapBlazor.csproj @@ -1,7 +1,7 @@ - + - 9.1.2 + 9.1.3-beta01 diff --git a/src/BootstrapBlazor/Components/Dialog/DialogCloseButton.cs b/src/BootstrapBlazor/Components/Dialog/DialogCloseButton.cs index 58ee70b014b..f3e9b502602 100644 --- a/src/BootstrapBlazor/Components/Dialog/DialogCloseButton.cs +++ b/src/BootstrapBlazor/Components/Dialog/DialogCloseButton.cs @@ -30,10 +30,10 @@ public partial class DialogCloseButton : Button /// protected override void OnParametersSet() { - base.OnParametersSet(); - Icon ??= IconTheme.GetIconByKey(ComponentIcons.DialogCloseButtonIcon); Text ??= Localizer[nameof(ModalDialog.CloseButtonText)]; + + base.OnParametersSet(); } /// diff --git a/test/UnitTest/Components/DialogCloseButtonTest.cs b/test/UnitTest/Components/DialogCloseButtonTest.cs new file mode 100644 index 00000000000..3e132bd2366 --- /dev/null +++ b/test/UnitTest/Components/DialogCloseButtonTest.cs @@ -0,0 +1,21 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the Apache 2.0 License +// See the LICENSE file in the project root for more information. +// Maintainer: Argo Zhang(argo@live.ca) Website: https://www.blazor.zone + +namespace UnitTest.Components; + +public class DialogCloseButtonTest : BootstrapBlazorTestBase +{ + [Fact] + public void Icon_Ok() + { + var cut = Context.RenderComponent(); + Assert.Equal("fa-solid fa-xmark", cut.Instance.Icon); + cut.Contains("fa-solid fa-xmark"); + + cut.SetParametersAndRender(pb => pb.Add(p => p.Icon, "test-icon")); + Assert.Equal("test-icon", cut.Instance.Icon); + cut.Contains("test-icon"); + } +}