AutoComplete 讨论 #6517
-
Is there an existing issue for this?
Is your feature request related to a problem? Please describe the problem.1、当上面有值时,必须使用键盘删掉上面的值,才能显示全部列表,再选择其它值,操作不方便。 Describe the solution you'd like建议参考antblazor的:
Additional contextNo response |
Beta Was this translation helpful? Give feedback.
Replies: 5 comments 4 replies
-
|
@movieliang Thank you for contacting us. We will give feedback later. |
Beta Was this translation helpful? Give feedback.
-
|
@movieliang 尽量一个 Issue 一个问题。多个问题讨论形式的可以去讨论组那边
|
Beta Was this translation helpful? Give feedback.
-
|
AutoComplete 这个组件用起来是有些问题, private List autoItems = new(); <AutoComplete @ref=txtQueryBox2 Id=@(uctPageFlag+"2") Color="Color.Secondary" Items=@autoitems @bind-Value="@uctValueWithQuery2" > 我用list做可选数据源,list.clear() 后再填充数据,AutoComplete 组件不会刷新,要点一下AutoComplete里的清除图标后才会刷新出来,@bind-Value="@uctValueWithQuery2" 我绑定了 uctValueWithQuery2,我把 uctValueWithQuery2=“” 后,AutoComplete 里面是会显示为空,但下拉里面的可选项还是上次查询的,也只能点一下AutoComplete里的清除图标后才会刷新出来。await txtQueryBox1.FocusAsync(); 没有效果,我把 AutoComplete 替换成 BootstrapInput 组件后,BootstrapInput 的 FocusAsync() 属性是可用的!希望这些问题能早日解决! |
Beta Was this translation helpful? Give feedback.
-
|
非常感谢您的回复,我肯定是有执行 StateHasChanged(); 的,也清理过浏览器的缓存,就是没有刷新出来!
声明数据源:
[NotNull]
private List<string> Field1ValueItems = new();
定义组件:
<AutoComplete ***@***.***=txtQueryBox1 Id=@(uctPageFlag+"1") Color="Color.Secondary" ***@***.*** @***@***.***" />
public Task uctField1ValueItems(string[] value)
{
Field1ValueItems.Clear(); //清空列表
Field1ValueItems.AddRange(value); //重新填充列表
uctValueWithQuery1 = ""; // AutoComplete 会被清空,但获得焦点后下拉打开时还是显示上次查询的结果
StateHasChanged(); //执行后 AutoComplete 里面的可选项没有刷新,显示的还是上次查询的结果
}
原始邮件
发件人:j4587698 ***@***.***>
发件时间:2025年11月6日 18:09
收件人:dotnetcore/BootstrapBlazor ***@***.***>
抄送:ssleryefeng ***@***.***>, Comment ***@***.***>
主题:Re: [dotnetcore/BootstrapBlazor] AutoComplete 讨论 (Discussion #6517)
这是个经典问题,你清理了list,组件怎么会知道?你要通知它啊,StateHasChanged, 执行了以后肯定就变了,不用你再点一次清除图标
—
Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you commented.
|
Beta Was this translation helpful? Give feedback.
-
|
非常感谢您的回复,我肯定是有执行 StateHasChanged(); 的,也清理过浏览器的缓存,就是没有刷新出来! 声明数据源: 定义组件: public Task uctField1ValueItems(string[] value) |
Beta Was this translation helpful? Give feedback.


@movieliang 尽量一个 Issue 一个问题。多个问题讨论形式的可以去讨论组那边
AutoComplete我们设计初衷是辅助录入(可以快速选择)但是目前是跟随这种提示方式,所以只能全部删除后才能显示默认候选项,也可以通过自定义模式自定义返回候选值