Skip to content

Commit

Permalink
fix(table): missing drag event when use dynamic data (#2369)
Browse files Browse the repository at this point in the history
* fix: 修复 TH 时间丢失导致内存泄露问题

* chore: bump version 7.12.2-beta03

* test: 更新单元测试
  • Loading branch information
ArgoZhang authored Nov 14, 2023
1 parent 4c5da20 commit 0d6f781
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/BootstrapBlazor/BootstrapBlazor.csproj
Original file line number Diff line number Diff line change
@@ -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'">
Expand Down
13 changes: 13 additions & 0 deletions src/BootstrapBlazor/Components/Table/Table.razor.js
Original file line number Diff line number Diff line change
Expand Up @@ -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')

Expand Down
4 changes: 2 additions & 2 deletions test/UnitTest/Components/PaginationTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ public void GotoTemplate_Ok()
}

[Fact]
public void GotoNavigator_Ok()
public async Task GotoNavigator_Ok()
{
var index = 0;
var cut = Context.RenderComponent<Pagination>(pb =>
Expand All @@ -94,7 +94,7 @@ public void GotoNavigator_Ok()

var navigator = cut.FindComponent<GotoNavigator>();
var input = navigator.Find("input");
cut.InvokeAsync(() =>
await cut.InvokeAsync(() =>
{
input.Change("5");
input.KeyUp("Enter");
Expand Down

0 comments on commit 0d6f781

Please sign in to comment.