ant-design / ant-design/pro-components
🐛[BUG] ProFormText onMetaChange 没有触发
- Dominant language
- TypeScript
- Stars
- 4.8k
- Forks
- 1.4k
- Avg merge
- 10h 44m
- Merged PRs (30d)
- 3
Description
我需要在一个手机号input,当用户输入正确的手机号后(即满足rules pattern需求)即通知父组件,让父组件查询远程接口该手机号是否存在。
由于没有找到 onStatusChange等方法,就尝试使用 onMetaChange 方法,但是该方法无论怎么输入、输入的手机号是否正确,都无法触发。
```
const telRules = [
{
required: true,
message: (
),
},
{
pattern: TelRegPattern,
message: (
),
},
];
const TelField: React.FC = () => {
const intl = useIntl();
const onMetaChange=(meta: MetaEvent)=>{
console.log(meta)
}
return (
,
autoComplete:'on',
}}
name="tel"
placeholder={intl.formatMessage({
id: 'pages.login.phoneNumber.placeholder',
defaultMessage: '手机号',
})}
rules={telRules}
onMetaChange={onMetaChange}
/>
);
};
```
Contributor guide
Research direction
Start by reproducing the provided ProFormText example with the telRules pattern and onMetaChange callback. Trace how ProFormText handles the callback and validation metadata; done means the callback reports input or validation changes as described, with the behavior covered by an appropriate test.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- react, typescript
- Domain
- frontend
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100