From 3d391fb8aa875138b37e300a9a0112a1fae20bb9 Mon Sep 17 00:00:00 2001 From: maliming Date: Tue, 12 May 2026 13:25:24 +0800 Subject: [PATCH] Apply MudBlazor 9 runtime fixes and QA polish - MudMenu: switch ActivatorContent to MenuContext.ToggleAsync pattern (v9 breaking) - MudForm: rename Validate to ValidateAsync (v9.1 obsoletion) - MudInput: replace AutoGrow with Sizing for textarea - DataGrid: add white-space:nowrap on header to prevent CJK characters stacking vertically - BlockUI: shrink loading spinner inside mud-dialog - Search field: switch Label to Placeholder so the text shows next to the magnifier icon --- .../AbpMudCrudPageBase.cs | 4 +-- .../MudTextAreaExtensionProperty.razor | 2 +- .../wwwroot/volo.abp.mudblazorui.css | 27 ++++++++++++++++++- .../Pages/Account/AccountManage.razor.cs | 4 +-- .../Themes/Basic/LanguageSwitch.razor | 4 +-- .../Themes/Basic/LoginDisplay.razor | 4 +-- .../Themes/Basic/LanguageSwitch.razor | 4 +-- .../Themes/Basic/LoginDisplay.razor | 4 +-- .../Pages/Identity/UserManagement.razor | 2 +- .../PermissionManagementModal.razor | 2 +- ...ResourcePermissionManagementModal.razor.cs | 4 +-- .../EmailSettingGroupViewComponent.razor.cs | 4 +-- .../TenantManagement.razor.cs | 4 +-- 13 files changed, 47 insertions(+), 22 deletions(-) diff --git a/framework/src/Volo.Abp.MudBlazorUI/AbpMudCrudPageBase.cs b/framework/src/Volo.Abp.MudBlazorUI/AbpMudCrudPageBase.cs index 3d27ab8dd8..9bc201bdca 100644 --- a/framework/src/Volo.Abp.MudBlazorUI/AbpMudCrudPageBase.cs +++ b/framework/src/Volo.Abp.MudBlazorUI/AbpMudCrudPageBase.cs @@ -469,7 +469,7 @@ public abstract class AbpMudCrudPageBase< var isValid = true; if (CreateFormRef != null) { - await CreateFormRef.Validate(); + await CreateFormRef.ValidateAsync(); isValid = CreateFormRef.IsValid; } @@ -527,7 +527,7 @@ public abstract class AbpMudCrudPageBase< var isValid = true; if (EditFormRef != null) { - await EditFormRef.Validate(); + await EditFormRef.ValidateAsync(); isValid = EditFormRef.IsValid; } diff --git a/framework/src/Volo.Abp.MudBlazorUI/Components/ObjectExtending/MudTextAreaExtensionProperty.razor b/framework/src/Volo.Abp.MudBlazorUI/Components/ObjectExtending/MudTextAreaExtensionProperty.razor index 2aa3e55f75..4d26db8deb 100644 --- a/framework/src/Volo.Abp.MudBlazorUI/Components/ObjectExtending/MudTextAreaExtensionProperty.razor +++ b/framework/src/Volo.Abp.MudBlazorUI/Components/ObjectExtending/MudTextAreaExtensionProperty.razor @@ -9,7 +9,7 @@ Label="@PropertyInfo.GetLocalizedDisplayName(StringLocalizerFactory)" @bind-Value="@Value" Lines="3" - AutoGrow="true" + Sizing="InputSizing.Auto" Disabled="IsReadonlyField" Validation="@((Func)Validate)" Immediate="true" /> diff --git a/framework/src/Volo.Abp.MudBlazorUI/wwwroot/volo.abp.mudblazorui.css b/framework/src/Volo.Abp.MudBlazorUI/wwwroot/volo.abp.mudblazorui.css index bd6174466b..2562386a54 100644 --- a/framework/src/Volo.Abp.MudBlazorUI/wwwroot/volo.abp.mudblazorui.css +++ b/framework/src/Volo.Abp.MudBlazorUI/wwwroot/volo.abp.mudblazorui.css @@ -57,4 +57,29 @@ .abp-crud-page-header-actions { display: flex; gap: 8px; -} \ No newline at end of file +} +/* BlockUI spinner inside mud-dialog: shrink to fit short modal bodies (e.g. file upload modal). + abp.css defines a 150px x 150px spinner via .abp-block-area-busy:before, which gets clipped + by mud-dialog's overflow when the modal content is short. */ +.mud-dialog .abp-block-area.abp-block-area-busy:before { + width: 48px; + height: 48px; + top: calc(50% - 24px); + left: calc(50% - 24px); +} + +.mud-dialog .abp-block-area.abp-block-area-busy:after { + font-size: 12px; +} + + +/* DataGrid header: prevent CJK characters from breaking one-per-line when column is narrow. + v9 column-header is a flex container with flex item width:100%; without nowrap, CJK + (no word boundary) collapses to min-content = single character width, stacking each + header character vertically. */ +.mud-data-grid .mud-table-cell .column-header .sortable-column-header, +.mud-data-grid .mud-table-cell .column-header > span:not(.column-options), +.mud-data-grid .mud-table-head .mud-table-cell { + white-space: nowrap; +} + diff --git a/modules/account/src/Volo.Abp.Account.Blazor.MudBlazor/Pages/Account/AccountManage.razor.cs b/modules/account/src/Volo.Abp.Account.Blazor.MudBlazor/Pages/Account/AccountManage.razor.cs index a4fc96941c..fa0bc1c31b 100644 --- a/modules/account/src/Volo.Abp.Account.Blazor.MudBlazor/Pages/Account/AccountManage.razor.cs +++ b/modules/account/src/Volo.Abp.Account.Blazor.MudBlazor/Pages/Account/AccountManage.razor.cs @@ -59,7 +59,7 @@ public partial class AccountManage return; } - await _changePasswordForm.Validate(); + await _changePasswordForm.ValidateAsync(); if (!_changePasswordForm.IsValid) { return; @@ -100,7 +100,7 @@ public partial class AccountManage return; } - await _personalInfoForm.Validate(); + await _personalInfoForm.ValidateAsync(); if (!_personalInfoForm.IsValid) { diff --git a/modules/basic-theme/src/Volo.Abp.AspNetCore.Components.Server.MudBlazorBasicTheme/Themes/Basic/LanguageSwitch.razor b/modules/basic-theme/src/Volo.Abp.AspNetCore.Components.Server.MudBlazorBasicTheme/Themes/Basic/LanguageSwitch.razor index 6f68415b1f..601479a35f 100644 --- a/modules/basic-theme/src/Volo.Abp.AspNetCore.Components.Server.MudBlazorBasicTheme/Themes/Basic/LanguageSwitch.razor +++ b/modules/basic-theme/src/Volo.Abp.AspNetCore.Components.Server.MudBlazorBasicTheme/Themes/Basic/LanguageSwitch.razor @@ -9,8 +9,8 @@ @if (_otherLanguages != null && _otherLanguages.Any()) { - - + + @_currentLanguage.DisplayName diff --git a/modules/basic-theme/src/Volo.Abp.AspNetCore.Components.Server.MudBlazorBasicTheme/Themes/Basic/LoginDisplay.razor b/modules/basic-theme/src/Volo.Abp.AspNetCore.Components.Server.MudBlazorBasicTheme/Themes/Basic/LoginDisplay.razor index 8a55cd7751..a48e7971dd 100644 --- a/modules/basic-theme/src/Volo.Abp.AspNetCore.Components.Server.MudBlazorBasicTheme/Themes/Basic/LoginDisplay.razor +++ b/modules/basic-theme/src/Volo.Abp.AspNetCore.Components.Server.MudBlazorBasicTheme/Themes/Basic/LoginDisplay.razor @@ -14,8 +14,8 @@ - - + + diff --git a/modules/basic-theme/src/Volo.Abp.AspNetCore.Components.WebAssembly.MudBlazorBasicTheme/Themes/Basic/LanguageSwitch.razor b/modules/basic-theme/src/Volo.Abp.AspNetCore.Components.WebAssembly.MudBlazorBasicTheme/Themes/Basic/LanguageSwitch.razor index 7d059a91ff..3add335cd7 100644 --- a/modules/basic-theme/src/Volo.Abp.AspNetCore.Components.WebAssembly.MudBlazorBasicTheme/Themes/Basic/LanguageSwitch.razor +++ b/modules/basic-theme/src/Volo.Abp.AspNetCore.Components.WebAssembly.MudBlazorBasicTheme/Themes/Basic/LanguageSwitch.razor @@ -11,8 +11,8 @@ @if (_otherLanguages != null && _otherLanguages.Any()) { - - + + @_currentLanguage.DisplayName diff --git a/modules/basic-theme/src/Volo.Abp.AspNetCore.Components.WebAssembly.MudBlazorBasicTheme/Themes/Basic/LoginDisplay.razor b/modules/basic-theme/src/Volo.Abp.AspNetCore.Components.WebAssembly.MudBlazorBasicTheme/Themes/Basic/LoginDisplay.razor index 2c6fbf6c6c..44972ae16a 100644 --- a/modules/basic-theme/src/Volo.Abp.AspNetCore.Components.WebAssembly.MudBlazorBasicTheme/Themes/Basic/LoginDisplay.razor +++ b/modules/basic-theme/src/Volo.Abp.AspNetCore.Components.WebAssembly.MudBlazorBasicTheme/Themes/Basic/LoginDisplay.razor @@ -17,8 +17,8 @@ - - + + diff --git a/modules/identity/src/Volo.Abp.Identity.Blazor.MudBlazor/Pages/Identity/UserManagement.razor b/modules/identity/src/Volo.Abp.Identity.Blazor.MudBlazor/Pages/Identity/UserManagement.razor index 23ac8872c5..77f335eed4 100644 --- a/modules/identity/src/Volo.Abp.Identity.Blazor.MudBlazor/Pages/Identity/UserManagement.razor +++ b/modules/identity/src/Volo.Abp.Identity.Blazor.MudBlazor/Pages/Identity/UserManagement.razor @@ -23,7 +23,7 @@ diff --git a/modules/permission-management/src/Volo.Abp.PermissionManagement.Blazor.MudBlazor/Components/ResourcePermissionManagementModal.razor.cs b/modules/permission-management/src/Volo.Abp.PermissionManagement.Blazor.MudBlazor/Components/ResourcePermissionManagementModal.razor.cs index 485451c5bf..e45473bb04 100644 --- a/modules/permission-management/src/Volo.Abp.PermissionManagement.Blazor.MudBlazor/Components/ResourcePermissionManagementModal.razor.cs +++ b/modules/permission-management/src/Volo.Abp.PermissionManagement.Blazor.MudBlazor/Components/ResourcePermissionManagementModal.razor.cs @@ -231,7 +231,7 @@ public partial class ResourcePermissionManagementModal return; } - await _createFormRef.Validate(); + await _createFormRef.ValidateAsync(); if (!_createFormRef.IsValid) { return; @@ -266,7 +266,7 @@ public partial class ResourcePermissionManagementModal return; } - await _editFormRef.Validate(); + await _editFormRef.ValidateAsync(); if (!_editFormRef.IsValid) { return; diff --git a/modules/setting-management/src/Volo.Abp.SettingManagement.Blazor.MudBlazor/Pages/SettingManagement/EmailSettingGroup/EmailSettingGroupViewComponent.razor.cs b/modules/setting-management/src/Volo.Abp.SettingManagement.Blazor.MudBlazor/Pages/SettingManagement/EmailSettingGroup/EmailSettingGroupViewComponent.razor.cs index 9e15fad338..28c74ad285 100644 --- a/modules/setting-management/src/Volo.Abp.SettingManagement.Blazor.MudBlazor/Pages/SettingManagement/EmailSettingGroup/EmailSettingGroupViewComponent.razor.cs +++ b/modules/setting-management/src/Volo.Abp.SettingManagement.Blazor.MudBlazor/Pages/SettingManagement/EmailSettingGroup/EmailSettingGroupViewComponent.razor.cs @@ -68,7 +68,7 @@ public partial class EmailSettingGroupViewComponent return; } - await _emailFormRef.Validate(); + await _emailFormRef.ValidateAsync(); if (!_emailFormRef.IsValid) { return; @@ -132,7 +132,7 @@ public partial class EmailSettingGroupViewComponent return; } - await _testEmailFormRef.Validate(); + await _testEmailFormRef.ValidateAsync(); if (!_testEmailFormRef.IsValid) { return; diff --git a/modules/tenant-management/src/Volo.Abp.TenantManagement.Blazor.MudBlazor/Pages/TenantManagement/TenantManagement.razor.cs b/modules/tenant-management/src/Volo.Abp.TenantManagement.Blazor.MudBlazor/Pages/TenantManagement/TenantManagement.razor.cs index 4587475f01..dcfb0c3152 100644 --- a/modules/tenant-management/src/Volo.Abp.TenantManagement.Blazor.MudBlazor/Pages/TenantManagement/TenantManagement.razor.cs +++ b/modules/tenant-management/src/Volo.Abp.TenantManagement.Blazor.MudBlazor/Pages/TenantManagement/TenantManagement.razor.cs @@ -163,7 +163,7 @@ public partial class TenantManagement return; } - await _createFormRef.Validate(); + await _createFormRef.ValidateAsync(); if (!_createFormRef.IsValid) { return; @@ -179,7 +179,7 @@ public partial class TenantManagement return; } - await _editFormRef.Validate(); + await _editFormRef.ValidateAsync(); if (!_editFormRef.IsValid) { return;