【发布时间】:2022-08-23 16:22:04
【问题描述】:
当我在文本字段中输入字符串的一部分时,如果我输入 112,下拉列表中的选项不会被过滤,它不会仅显示带有 112 的值,它会显示所有选项。
<Autocomplete
disabled={row.group_mapping_id && !(\'editClicked\' in row)}
freeSolo
value={row.client_id}
onChange={(event, newValue) => props.onChangeTableInput(\'client_id\', index, newValue, row)}
options={props.clientDetails}
getOptionLabel={(option) => {
if (typeof option === \'string\') {
return option;
}
return option.client_id;
}}
style={{width: \'120px\'}}
disableClearable
renderInput={(params) => <TextField {...params}
variant=\'outlined\'
inputProps={{
...params.inputProps,
autoComplete: \"disabled\",
type: \'search\'
}} />}
/>
props.clientDetails ,[
{client_master_id: 73, client_id: \"OM112\", client_name: \"AOP\"},…]
{client_master_id: 73, client_id: \"OH112\", client_name: \"AKI\"}
{client_master_id: 74, client_id: \"OL112\", client_name: \"AJU2\"}
{client_master_id: 75, client_id: \"OLO112\", client_name: \"ABG4\"}
{client_master_id: 80, client_id: \"OM912\", client_name: \"ACVGh\"}
]
标签: reactjs material-ui autocomplete