fix: 修改自动补全筛选失效问题
This commit is contained in:
parent
d072b32b17
commit
5b4fbea13f
@ -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