masastack / MASA.Blazor

Blazor UI component library based on Material Design. Support Blazor Server, Blazor WebAssembly and MAUI Blazor.
https://docs.masastack.com/blazor/getting-started/installation
MIT License
1.11k stars 149 forks source link

Selects 有没有接受用户输入,然后动态提供下拉选项的功能? #1869

Closed huxinshuo closed 3 weeks ago

huxinshuo commented 3 weeks ago

Selects 有没有接受用户输入然后动态提供下拉选项的功能?看了示例都是固定的下拉选项。 比如输入 一个字,然后返回可用的选项。

capdiem commented 3 weeks ago

@huxinshuo 有Autocomplete组件。

huxinshuo commented 3 weeks ago

我在事件里面加了MessageBox.Show(v); 没有任何提示会查出所有items :我先输入“山” 会显示“山”的内容 MessageBox也会提示“山”,然后重新点控件 MessageBox没有任何提示,却显示全部items ,说明没经过事件就查出了所有items ? private async Task QuerySelections(string v) { if (string.IsNullOrEmpty(v) || v == _select ) { return; }

 _loading = true;
 MessageBox.Show(v);
 await Task.Delay(500);
huxinshuo commented 3 weeks ago

就是如果是“”会查出所有items 可是事件也没提示。 “”这个是不是输入的瞬间产生的?

capdiem commented 3 weeks ago

@huxinshuo 请提供完整的代码~

capdiem commented 3 weeks ago

@huxinshuo 谁调的QuerySelections我也不知道呀 = =

huxinshuo commented 3 weeks ago

没事了,是调用错了~😂