Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

The AutoComplete component, when used as an item in the Form, does not refresh the dropdown content of the AutoComplete component after resetting the form content using form. resetFields() #7586

Open
1 task
ShuangxiHan opened this issue May 17, 2024 · 0 comments

Comments

@ShuangxiHan
Copy link

  • I have searched the issues of this repository and believe that this is not a duplicate.

Version

4.2.1

Environment

windows11、node20.10.0、Google Chrome124.0.6367.201(正式版本)vue3.4.21

Reproduction link

https://gitee.com/han_double_happiness/demo.git

Steps to reproduce

重置 <script setup> import { ref } from 'vue' const formRef = ref() const formState = ref({}) const options = ref([ { label: '张三', value: '张三' }, { label: '李四', value: '李四' } ]) const rest = () => { formRef.value.resetFields() // formState.value = {} } const filterOption = (inputValue, option) => { return option.label.includes(inputValue) } </script>

What is expected?

As shown in the above code, under normal circumstances,After clearing the data in the a-auto complete component, the dropdown list of the a-auto complete component should display all the data to be queried

What is actually happening?

Actually, when I was selecting a Zhang San, there was only one Zhang San in the drop-down list, but after clearing it, there was still only Zhang San left


If the above code manually deletes and uses the autoComplete component's built-in allowClear function in the input box one by one, it is not a problem. However, using the form's resetFields or manually clearing data is ineffective

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant