材料UI自动完成:用户输入时获取更新的选项列表
我正在使用材料UI自动完成,并且我想在用户键入时在下拉列表中显示新的过滤列表。
就像在第一张图片中一样,我们有完整列表:
在此处结束我们在用户键入“ Amer”之后的更新列表(3个元素);
有没有办法获取新列表的元素?
自动完成代码:
<Autocomplete
freeSolo
id="free-solo-2-demo"
disableClearable
options={top100Films.map((option) => option.title)}
renderInput={(params) => (
<TextField
{...params}
label="Search input"
InputProps={{
...params.InputProps,
type: 'search',
}}
/>
)}
/>
I'm using material ui autocomplete, and i want to get the new filtered list shown in the dropdown while user is typing .
like in first image we have the full list :
end here we have the updated list (3 elements) after user typed "amer" ;
is there a way to get the elements of the new list ?
autocomplete code :
<Autocomplete
freeSolo
id="free-solo-2-demo"
disableClearable
options={top100Films.map((option) => option.title)}
renderInput={(params) => (
<TextField
{...params}
label="Search input"
InputProps={{
...params.InputProps,
type: 'search',
}}
/>
)}
/>
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论