Skip to content

Commit 0d6f781

Browse files
authored
fix(table): missing drag event when use dynamic data (#2369)
* fix: 修复 TH 时间丢失导致内存泄露问题 * chore: bump version 7.12.2-beta03 * test: 更新单元测试
1 parent 4c5da20 commit 0d6f781

File tree

3 files changed

+16
-3
lines changed

3 files changed

+16
-3
lines changed

src/BootstrapBlazor/BootstrapBlazor.csproj

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<Project Sdk="Microsoft.NET.Sdk.Razor">
22

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

77
<ItemGroup Condition="'$(TargetFramework)' == 'net5.0'">

src/BootstrapBlazor/Components/Table/Table.razor.js

+13
Original file line numberDiff line numberDiff line change
@@ -195,6 +195,19 @@ const resetTableWidth = table => {
195195
const setResizeListener = table => {
196196
const eff = (col, toggle) => {
197197
const th = col.closest('th')
198+
if (th.parentNode === null) {
199+
EventHandler.off(col, 'click')
200+
EventHandler.off(col, 'mousedown')
201+
EventHandler.off(col, 'touchstart')
202+
203+
table.tables.forEach(t => {
204+
const cells = t.querySelectorAll('.border-resize');
205+
cells.forEach(c => c.classList.remove('border-resize'))
206+
})
207+
208+
return
209+
}
210+
198211
if (toggle) th.classList.add('border-resize')
199212
else th.classList.remove('border-resize')
200213

test/UnitTest/Components/PaginationTest.cs

+2-2
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ public void GotoTemplate_Ok()
7878
}
7979

8080
[Fact]
81-
public void GotoNavigator_Ok()
81+
public async Task GotoNavigator_Ok()
8282
{
8383
var index = 0;
8484
var cut = Context.RenderComponent<Pagination>(pb =>
@@ -94,7 +94,7 @@ public void GotoNavigator_Ok()
9494

9595
var navigator = cut.FindComponent<GotoNavigator>();
9696
var input = navigator.Find("input");
97-
cut.InvokeAsync(() =>
97+
await cut.InvokeAsync(() =>
9898
{
9999
input.Change("5");
100100
input.KeyUp("Enter");

0 commit comments

Comments
 (0)