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:
commit
fb91a230fb
@ -11,8 +11,13 @@ export const AutoComplete = (props) => {
|
|||||||
const [defultValue, setDefultValue] = useState([]);
|
const [defultValue, setDefultValue] = useState([]);
|
||||||
const api = useAPIClient();
|
const api = useAPIClient();
|
||||||
const [options, setOptions] = useState([]);
|
const [options, setOptions] = useState([]);
|
||||||
const [value, setValue] = useState('');
|
|
||||||
const form = useForm();
|
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 () => {
|
useAsyncEffect(async () => {
|
||||||
const defultOptions = await api.request({
|
const defultOptions = await api.request({
|
||||||
|
Loading…
Reference in New Issue
Block a user