-
Notifications
You must be signed in to change notification settings - Fork 589
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
[Select]Select.AutoComplete与Field混合使用时无法在重置Field后正确重置可选项 #4873
Labels
Comments
这是您为 Fusion/Next 提的第一个 issue,感谢您对 Fusion 的信任和支持,我们会尽快进行处理。 |
重置只会重置值,而不会重置其他属性。如果需要联动重置值,可以在调 reset 的时候自己把 dataSource 重置回来。 |
上述例子中,<Select.AutoComplete />中传入的dataSource是固定的:
可选项的展示筛选是组件自行完成的,值重置后,应该会展示全部可选项才对。 |
目前快速的解决方法有两种:
<Select.AutoComplete name="test">
<Select.Option value={1}>1</Select.Option>
<Select.Option value={2}>2</Select.Option>
</Select.AutoComplete>
const App = () => {
const dataSource = ['a', 'b', 'c', 'd'].map((item) => ({
label: item,
value: item,
}));
const field = Field.useField();
return (
<div>
<Form field={field}>
<Form.Item label="Test">
<Select.AutoComplete name="test" dataSource={dataSource} />
</Form.Item>
</Form>
<Button onClick={() => field.resetToDefault()}>Reset</Button>
</div>
);
};
createRoot(document.getElementById('root')!).render(<App />) 下个版本这个问题应该会修复,可以关注下 |
Closed
zizairufengLT
added a commit
to zizairufengLT/next
that referenced
this issue
Aug 16, 2024
zizairufengLT
added a commit
to zizairufengLT/next
that referenced
this issue
Aug 21, 2024
zizairufengLT
added a commit
to zizairufengLT/next
that referenced
this issue
Aug 21, 2024
zizairufengLT
added a commit
to zizairufengLT/next
that referenced
this issue
Aug 22, 2024
zizairufengLT
added a commit
to zizairufengLT/next
that referenced
this issue
Aug 22, 2024
zizairufengLT
added a commit
to zizairufengLT/next
that referenced
this issue
Aug 23, 2024
eternalsky
pushed a commit
that referenced
this issue
Aug 30, 2024
eternalsky
pushed a commit
that referenced
this issue
Sep 10, 2024
fix in 1.27.23, https://hitu.antgroup-inc.cn/codeblocks/c1b98471 |
luolin-ck
pushed a commit
to luolin-ck/next
that referenced
this issue
Sep 10, 2024
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
Component
Select
Reproduction link
https://hitu.antgroup-inc.cn/codeblocks/f2bece99
Code
Steps to reproduce
在Select中选择"a" -> 点击下方的Reset按钮 -> 重新点击Select,此时可选项只有"a"
The text was updated successfully, but these errors were encountered: