fix(table): missing drag event when use dynamic data (#2369)

* fix: 修复 TH 时间丢失导致内存泄露问题

* chore: bump version 7.12.2-beta03

* test: 更新单元测试
This commit is contained in:
Argo Zhang
2023-11-14 16:13:23 +08:00
committed by GitHub
parent 4c5da2022b
commit 0d6f781d5d
3 changed files with 16 additions and 3 deletions

View File

@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk.Razor">
<PropertyGroup>
<Version>7.12.2-beta02</Version>
<Version>7.12.2-beta03</Version>
</PropertyGroup>
<ItemGroup Condition="'$(TargetFramework)' == 'net5.0'">

View File

@@ -195,6 +195,19 @@ const resetTableWidth = table => {
const setResizeListener = table => {
const eff = (col, toggle) => {
const th = col.closest('th')
if (th.parentNode === null) {
EventHandler.off(col, 'click')
EventHandler.off(col, 'mousedown')
EventHandler.off(col, 'touchstart')
table.tables.forEach(t => {
const cells = t.querySelectorAll('.border-resize');
cells.forEach(c => c.classList.remove('border-resize'))
})
return
}
if (toggle) th.classList.add('border-resize')
else th.classList.remove('border-resize')

View File

@@ -78,7 +78,7 @@ public class PaginationTest : BootstrapBlazorTestBase
}
[Fact]
public void GotoNavigator_Ok()
public async Task GotoNavigator_Ok()
{
var index = 0;
var cut = Context.RenderComponent<Pagination>(pb =>
@@ -94,7 +94,7 @@ public class PaginationTest : BootstrapBlazorTestBase
var navigator = cut.FindComponent<GotoNavigator>();
var input = navigator.Find("input");
cut.InvokeAsync(() =>
await cut.InvokeAsync(() =>
{
input.Change("5");
input.KeyUp("Enter");