Replies: 1 comment
-
const formRef = useRef(); // use ref
// ...other codes
<ProForm formRef={formRef}> // here
<ProForm.Item
label={<Title level={5}>{title}</Title>}
name={'Speed'}
>
<Input placeholder={placeholder} rules={customRules}
onChange={(value)} => { // using onChange set the form title value.
formRef?.current?.setFieldValue(title, formattedValue );
}}
/>
</ProForm.Item>
<ProFormDependency ignoreFormListField name={['Speed']}>
{({ Speed }) => {
return (
<ProFormText
// fieldProps={{ defaultValue: formattedValue }} // not worked
label={Speed}
name={title}
// initialValue={formattedValue} // do not use value, initialValue, defaultValue
proFieldProps={{ mode: 'read' }}
/>
);
</ProFormDependency>
</ProForm> |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
For example, I have two Form items:
The question is: I can update any value inside ProFormDependency, name, title, anything. But I want to update
value
,initialValue
ordefaultValue
initializing one time, and does not update.If I use
Input
component from antd, form does not see parse such value.Beta Was this translation helpful? Give feedback.
All reactions