Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
<section ignore>
@((MarkupString)@Localizer["NormalDesc"].Value)
</section>
<Button OnClick="@(()=>Model1=null)">测试用请删除:点我清空Model1</Button>
<AutoFill @bind-Value="Model1" Items="Items1" IsAutoClearWhenInvalid="true"
IsLikeMatch="true" OnGetDisplayText="OnGetDisplayText" IsSelectAllTextOnFocus="true">
<ItemTemplate>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -213,6 +213,14 @@ private AttributeItem[] GetAttributes() =>
Type = "bool",
ValueList = "true/false",
DefaultValue = "false"
},
new()
{
Name=nameof(AutoFill<string>.IsAutoClearWhenInvalid),
Description=Localizer["AttIsAutoClearWhenInvalid"],
Type="bool",
ValueList="true/false",
DefaultValue="false"
}
];
}
3 changes: 2 additions & 1 deletion src/BootstrapBlazor.Server/Locales/en-US.json
Original file line number Diff line number Diff line change
Expand Up @@ -1997,7 +1997,8 @@
"IsVirtualizeTitle": "Virtualize",
"IsVirtualizeIntro": "Set <code>IsVirtualize</code> to <b>true</b> enable virtual scroll for large data",
"IsVirtualizeDescription": "Component virtual scrolling supports two ways of providing data through <code>Items</code> or <code>OnQueryAsync</code> callback methods",
"AttrIsVirtualize": "Wether to enable virtualize"
"AttrIsVirtualize": "Wether to enable virtualize",
"AttIsAutoClearWhenInvalid": "Whether to automatically clear invalid values when focus leaves the component"
},
"BootstrapBlazor.Server.Components.Samples.AutoCompletes": {
"Title": "AutoComplete",
Expand Down
3 changes: 2 additions & 1 deletion src/BootstrapBlazor.Server/Locales/zh-CN.json
Original file line number Diff line number Diff line change
Expand Up @@ -1997,7 +1997,8 @@
"IsVirtualizeTitle": "虚拟滚动",
"IsVirtualizeIntro": "通过设置 <code>IsVirtualize</code> 参数开启组件虚拟功能特性",
"IsVirtualizeDescription": "组件虚拟滚动支持两种形式通过 <code>Items</code> 或者 <code>OnQueryAsync</code> 回调方法提供数据",
"AttrIsVirtualize": "是否开启虚拟滚动"
"AttrIsVirtualize": "是否开启虚拟滚动",
"AttIsAutoClearWhenInvalid":"焦点移除组件时是否自动清空无效值"
},
"BootstrapBlazor.Server.Components.Samples.AutoCompletes": {
"Title": "AutoComplete 自动完成",
Expand Down
1 change: 1 addition & 0 deletions src/BootstrapBlazor/Components/AutoFill/AutoFill.razor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -177,6 +177,7 @@ protected override void OnParametersSet()

_displayText = GetDisplayText(Value);
_clientValue = _displayText;
InvokeVoidAsync("setValue", Id, _displayText);
Items ??= [];
}

Expand Down
Loading