From 557107b96f041ae24003b08bbbe106817459337e Mon Sep 17 00:00:00 2001 From: Argo Zhang Date: Thu, 31 Oct 2024 20:14:20 +0800 Subject: [PATCH] fix(SelectTable): validate component shoud be skip validate in search panel (#4580) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * fix(Table): 增加缺失的 SkipValidate 设置 * fix: 增加搜索面板下取消验证逻辑 * fix: 更新单元测试 * chore: bump version 8.11.1-beta03 --- src/BootstrapBlazor/BootstrapBlazor.csproj | 2 +- src/BootstrapBlazor/Components/Table/Table.razor | 2 +- src/BootstrapBlazor/Utils/Utility.cs | 2 +- test/UnitTest/Components/DateTimePickerTest.cs | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/BootstrapBlazor/BootstrapBlazor.csproj b/src/BootstrapBlazor/BootstrapBlazor.csproj index d2412cb6e..39d7e71e6 100644 --- a/src/BootstrapBlazor/BootstrapBlazor.csproj +++ b/src/BootstrapBlazor/BootstrapBlazor.csproj @@ -1,7 +1,7 @@ - 8.11.1-beta02 + 8.11.1-beta03 diff --git a/src/BootstrapBlazor/Components/Table/Table.razor b/src/BootstrapBlazor/Components/Table/Table.razor index 99f463c6e..80bffbca4 100644 --- a/src/BootstrapBlazor/Components/Table/Table.razor +++ b/src/BootstrapBlazor/Components/Table/Table.razor @@ -995,7 +995,7 @@ } else { - + } } diff --git a/src/BootstrapBlazor/Utils/Utility.cs b/src/BootstrapBlazor/Utils/Utility.cs index 9083739f8..c4c7e5ab0 100644 --- a/src/BootstrapBlazor/Utils/Utility.cs +++ b/src/BootstrapBlazor/Utils/Utility.cs @@ -537,7 +537,7 @@ public static class Utility // 设置 SkipValidate 参数 if (IsValidComponent(componentType)) { - builder.AddAttribute(160, nameof(IEditorItem.SkipValidate), item.SkipValidate); + builder.AddAttribute(160, nameof(IEditorItem.SkipValidate), isSearch || item.SkipValidate); } builder.AddMultipleAttributes(170, CreateMultipleAttributes(fieldType, model, fieldName, item)); diff --git a/test/UnitTest/Components/DateTimePickerTest.cs b/test/UnitTest/Components/DateTimePickerTest.cs index 93501fd04..daf87af04 100644 --- a/test/UnitTest/Components/DateTimePickerTest.cs +++ b/test/UnitTest/Components/DateTimePickerTest.cs @@ -929,7 +929,7 @@ public class DateTimePickerTest : BootstrapBlazorTestBase pb.Add(a => a.AutoClose, true); }); await cut.InvokeAsync(() => button.Click()); - Assert.Equal(val, DateTime.Today.AddMonths(-1)); + Assert.Equal(val, DateTime.MinValue); } [Fact]