Skip to content

Commit a6167cd

Browse files
ArgoZhangj4587698
andauthored
fix(SelectGeneric): add dropdown-menu-body class (#6110)
* fix(SelectGeneric): 修复 body 丢失高度问题 * chore: bump version 9.6.5-beta03 Co-Authored-By: j4587698 <[email protected]> --------- Co-authored-by: j4587698 <[email protected]>
1 parent a0834cd commit a6167cd

File tree

2 files changed

+16
-14
lines changed

2 files changed

+16
-14
lines changed

src/BootstrapBlazor/BootstrapBlazor.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<Project Sdk="Microsoft.NET.Sdk.Razor">
22

33
<PropertyGroup>
4-
<Version>9.6.5-beta02</Version>
4+
<Version>9.6.5-beta03</Version>
55
</PropertyGroup>
66

77
<ItemGroup>

src/BootstrapBlazor/Components/SelectGeneric/SelectGeneric.razor

Lines changed: 15 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@
4141
}
4242
@if (IsVirtualize)
4343
{
44-
<div class="dropdown-virtual">
44+
<div class="dropdown-menu-body dropdown-virtual">
4545
@if (OnQueryAsync == null)
4646
{
4747
<Virtualize ItemSize="RowHeight" OverscanCount="OverscanCount" Items="@GetVirtualItems()" ChildContent="RenderRow" />
@@ -58,24 +58,26 @@
5858
}
5959
else
6060
{
61-
@foreach (var itemGroup in Rows.GroupBy(i => i.GroupName))
62-
{
63-
if (!string.IsNullOrEmpty(itemGroup.Key))
61+
<div class="dropdown-menu-body">
62+
@foreach (var itemGroup in Rows.GroupBy(i => i.GroupName))
6463
{
65-
if (GroupItemTemplate != null)
64+
if (!string.IsNullOrEmpty(itemGroup.Key))
6665
{
67-
@GroupItemTemplate(itemGroup.Key)
66+
if (GroupItemTemplate != null)
67+
{
68+
@GroupItemTemplate(itemGroup.Key)
69+
}
70+
else
71+
{
72+
<Divider Text="@itemGroup.Key" />
73+
}
6874
}
69-
else
75+
@foreach (var item in itemGroup)
7076
{
71-
<Divider Text="@itemGroup.Key" />
77+
@RenderRow(item)
7278
}
7379
}
74-
@foreach (var item in itemGroup)
75-
{
76-
@RenderRow(item)
77-
}
78-
}
80+
</div>
7981
}
8082
</div>
8183
@if (!IsPopover)

0 commit comments

Comments
 (0)