Skip to content

Commit 9c31447

Browse files
committed
Merge branch 'main' into refactor-tv
# Conflicts: # src/BootstrapBlazor/Components/Checkbox/Checkbox.razor.cs # src/BootstrapBlazor/Components/Checkbox/Checkbox.razor.js # test/UnitTest/Components/CheckboxListTest.cs
2 parents 71ad4b1 + 3cbd726 commit 9c31447

File tree

3 files changed

+4
-1
lines changed

3 files changed

+4
-1
lines changed

src/BootstrapBlazor/Components/Checkbox/Checkbox.razor.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -188,10 +188,12 @@ public async ValueTask<bool> OnTriggerClickAsync(CheckboxState? state = null)
188188
var ret = await OnBeforeStateChanged(val);
189189
if (ret == false)
190190
{
191+
// 阻止状态改变
191192
return false;
192193
}
193194
}
194195

196+
// 改变状态 由点击事件触发
195197
var render = await InternalStateChanged(val);
196198
if (render)
197199
{

src/BootstrapBlazor/Components/Checkbox/Checkbox.razor.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ export function init(id, invoke, method) {
2424
el.parentElement.classList.add('is-checked');
2525
}
2626
}
27-
var result = await invoke.invokeMethodAsync(method, state == "1" ? 0 : 1);
27+
const result = await invoke.invokeMethodAsync(method, state == "1" ? 0 : 1);
2828
if (result === false) {
2929
e.preventDefault();
3030
}

test/UnitTest/Components/CheckboxListTest.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,7 @@ public async Task Checkbox_OnTriggerClickAsync()
8585

8686
// JavaScript 调用 OnTriggerClickAsync 方法
8787
var val = await cut.Instance.OnTriggerClickAsync(CheckboxState.UnChecked);
88+
8889
Assert.True(val);
8990
Assert.Equal(CheckboxState.UnChecked, cut.Instance.State);
9091

0 commit comments

Comments
 (0)