mirror of
https://gitee.com/LongbowEnterprise/BootstrapBlazor.git
synced 2024-12-02 03:59:14 +08:00
feat(Slider): add OnBlurAsync parameter (#4525)
* feat(FloatingLabel): add OnBlurAsync parameter * feat: 增加 OnBlurAsync 回调方法 * refactor: 移动参数到基类 * refactor: 移动参数到基类 * refactor: 重构 AutoComplete 组件 * refactor: 重构 AutoFill 组件 * doc: 更新文档注释 * refactor: 复用基类事件 * refactor: 使用基类事件 * feat(Slider): add OnBlurAsync parameter * test: 更新单元测试
This commit is contained in:
parent
420f7f7689
commit
44c229c343
@ -20,5 +20,5 @@ else
|
||||
|
||||
@code {
|
||||
RenderFragment RenderRange =>
|
||||
@<input type="range" id="@Id" @attributes="@AdditionalAttributes" class="@ClassString" disabled="@IsDisabled" @bind-value="CurrentValueAsString" @bind-value:event="@EventString" step="@StepString" min="@MinString" max="@MaxString">;
|
||||
@<input type="range" id="@Id" @attributes="@AdditionalAttributes" class="@ClassString" disabled="@IsDisabled" @bind-value="CurrentValueAsString" @bind-value:event="@EventString" step="@StepString" min="@MinString" max="@MaxString" @onblur="OnBlur">;
|
||||
}
|
||||
|
@ -110,6 +110,23 @@ public class SliderTest : BootstrapBlazorTestBase
|
||||
Assert.Equal(1, expected);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public async Task OnBlurAsync_Ok()
|
||||
{
|
||||
var blur = false;
|
||||
var cut = Context.RenderComponent<Slider<int>>(builder =>
|
||||
{
|
||||
builder.Add(a => a.OnBlurAsync, v =>
|
||||
{
|
||||
blur = true;
|
||||
return Task.CompletedTask;
|
||||
});
|
||||
});
|
||||
var input = cut.Find("input");
|
||||
await cut.InvokeAsync(() => { input.Blur(); });
|
||||
Assert.True(blur);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void Range_OK()
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user