Skip to content

Commit e96725e

Browse files
committed
revert: 撤销清空逻辑
1 parent 81366c8 commit e96725e

File tree

1 file changed

+0
-37
lines changed

1 file changed

+0
-37
lines changed

src/BootstrapBlazor/Components/AutoFill/AutoFill.razor.cs

Lines changed: 0 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -99,12 +99,6 @@ public partial class AutoFill<TValue>
9999
[Parameter]
100100
public float RowHeight { get; set; } = 50f;
101101

102-
/// <summary>
103-
/// 失去焦点时判定输入框内容无效则清空内容
104-
/// </summary>
105-
[Parameter]
106-
public bool IsClearOnInvalid { get; set; } = false;
107-
108102
/// <summary>
109103
/// Gets or sets the overscan count for virtual scrolling. Default is 3.
110104
/// </summary>
@@ -281,35 +275,4 @@ public async Task TriggerFilter(string val)
281275
}
282276
_dropdown.Render();
283277
}
284-
285-
286-
protected virtual async Task OnBlur()
287-
{
288-
if (IsClearOnInvalid)
289-
{
290-
// 获取input的实际值
291-
var inputValue = await GetInputValue();
292-
293-
if (!string.IsNullOrEmpty(inputValue))
294-
{
295-
if (GetDisplayText(Value) != inputValue)
296-
{
297-
// 如果没有匹配项,清空输入和Model
298-
CurrentValue = default;
299-
await InvokeVoidAsync("setValue", Id, "");
300-
}
301-
}
302-
}
303-
304-
305-
if (OnBlurAsync != null)
306-
{
307-
await OnBlurAsync(Value);
308-
}
309-
}
310-
[JSInvokable]
311-
public async Task<string> GetInputValue()
312-
{
313-
return await InvokeAsync<string>("getInputValue", Id);
314-
}
315278
}

0 commit comments

Comments
 (0)