vueComponent / ant-design-vue

🌈 An enterprise-class UI components based on Ant Design and Vue. 🐜

Home Page:https://antdv.com/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

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()

ShuangxiHan opened this issue · comments

  • 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