danvick / form_builder_phone_field

MIT License
8 stars 25 forks source link

Phone Number validation #20

Open jasonlaw opened 2 years ago

jasonlaw commented 2 years ago

Hi,

I noticed the package is using phone_number to validate the initial value. In order for consistency, I would like to have the same validation as part of the validator. However, the phone_number parse is an async method, may I know how to include it as part of the validator?

Btw, it would be great if that can be a built-in validation for this component, of course I understand that will give problem with error translation text, may be another suggestion is to expose the parse/validate method so we can implement ourselves without needing to import the phone_number package again.

Thanks.