-
-
Notifications
You must be signed in to change notification settings - Fork 364
Closed
Description
Is there an existing issue for this?
- I have searched the existing issues
Describe the bug
虚拟滚动模式, 搜索后会卡在骨架屏界面
复现步骤
- 搜索输入 0035 回车, (搜索一个不在第一页的数据)
- 按Esc
另一种复现步骤
Expected Behavior
<DemoBlock Title="@Localizer["VirtualizationDynamicTitle"]"
Introduction="@Localizer["VirtualizationDynamicIntro"]"
Name="Dynamic">
<section ignore>@Localizer["VirtualizationDynamicDescription"]</section>
<Table TItem="Foo" class="table-virtualize-demo"
IsBordered="true" IsStriped="true"
ShowToolbar
ShowSearch
ShowAdvancedSearch="false"
ScrollMode="ScrollMode.Virtual" OnQueryAsync="OnQueryAsync">
<TableColumns>
<TableColumn @bind-Field="@context.DateTime" Width="180" />
<TableColumn @bind-Field="@context.Name" />
<TableColumn @bind-Field="@context.Address" Readonly="true" />
<TableColumn @bind-Field="@context.Education" />
<TableColumn @bind-Field="@context.Count" />
<TableColumn @bind-Field="@context.Complete" />
</TableColumns>
</Table>
</DemoBlock>
private async Task<QueryData<Foo>> OnQueryAsync(QueryPageOptions options)
{
await Task.Delay(200);
// 搜索
var items = options.SearchText!=null? Items.Where(a=>a.Name!.Contains(options.SearchText)) : Items;
// 获得搜索后的记录总数
var count = items.Count();
// 内存分页
if (options.IsPage)
{
items = items.Skip((options.PageIndex - 1) * options.PageItems).Take(options.PageItems);
}
else if (options.IsVirtualScroll)
{
items = items.Skip(options.StartIndex).Take(options.PageItems);
}
return new QueryData<Foo>()
{
Items = items,
TotalCount = count
};
}
Interactive render mode
Interactive Server (Interactive server-side rendering (interactive SSR) using Blazor Server)
Steps To Reproduce
解压替换文档文件 \BootstrapBlazor\src\BootstrapBlazor.Server\Components\Samples\Table
Exceptions (if any)
No response
.NET Version
NET9.0
Anything else?
No response
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working

