fix(agent): force form re-render when clicking tag to fill description
parent
0793d8549e
commit
3d46372688
|
|
@ -838,7 +838,12 @@ export default function AgentEditor() {
|
|||
{['客服助理', '内容创作', '数据分析', '私人教练'].map((label) => (
|
||||
<span
|
||||
key={label}
|
||||
onClick={() => form.setFieldsValue({ description: label })}
|
||||
onClick={() => {
|
||||
// 这里需要通知表单重新渲染
|
||||
form.setFieldsValue({ description: label });
|
||||
// 为了确保组件感知到变化,强制触发一下更新(如果表单没有响应)
|
||||
form.validateFields(['description']);
|
||||
}}
|
||||
style={{
|
||||
padding: '6px 10px',
|
||||
borderRadius: 999,
|
||||
|
|
|
|||
Loading…
Reference in New Issue