mirror of
https://github.com/dotnetcore/BootstrapBlazor.git
synced 2026-03-31 02:30:46 +08:00
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:
@@ -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'">
|
||||
|
||||
@@ -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')
|
||||
|
||||
|
||||
@@ -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");
|
||||
|
||||
Reference in New Issue
Block a user