boyuai / antd-country-phone-input

Country phone input component as standard Ant.Design form item
https://boyuai.github.io/antd-country-phone-input/
60 stars 35 forks source link

[question] How to validate Select and Input components separately using Antd Form validation? #56

Closed felipesilvati closed 2 years ago

felipesilvati commented 2 years ago

I'm currently working on a form that looks like this:

<Form.Item rules={myRules} hasFeedback>
  <ConfigProvider locale={en}>
     <CountryPhoneInput />
  </ConfigProvider>
</Form.Item>

But when the user selects the country, I already get a validation error on both <Select /> and <Input /> elements, like this:

image

I wonder if there's a way to get a separate validation status like this: image

Thanks!

helsonxiao commented 2 years ago

Thanks for your reporting! I am wondering if select component need to be validated. What about just hide ant design's built-in error icon in this case?🤔

felipesilvati commented 2 years ago

Fair enough, that should do it for now! Thanks