Merge pull request 'fix: 修改自动补全重置后筛选失效问题' (#402) from fix_multipleSelect into @hera/dev

Reviewed-on: daoyoucloud/tachycode#402
Reviewed-by: sealday <zhanglin@daoyoucloud.com>
This commit is contained in:
sealday 2024-03-18 15:07:29 +08:00
commit fb91a230fb

View File

@ -11,8 +11,13 @@ export const AutoComplete = (props) => {
const [defultValue, setDefultValue] = useState([]);
const api = useAPIClient();
const [options, setOptions] = useState([]);
const [value, setValue] = useState('');
const form = useForm();
const autoValue = form.values['custom'] ? form.values['custom'][fieldSchema['collectionName']] : '';
const [value, setValue] = useState(autoValue);
if (!autoValue && value) {
setValue('');
setOptions(defultValue);
}
useAsyncEffect(async () => {
const defultOptions = await api.request({