zero-to-mastery / WebBlocks

zero-to-mastery re-usable web component library.
https://zero-to-mastery.github.io/WebBlocks/
MIT License
22 stars 60 forks source link

Telephone Input Component #16

Open software-trizzey opened 3 years ago

software-trizzey commented 3 years ago

Are you sick and tired of having to recreate a form field that can handle and validate telephone numbers?

Yeah, us too.

Therefore, we would like our library to include a Telephone component that only accepts text matching a particular set of standard telephone formats.

Example:

The more flexible this component is the better. This ideally means we would like to see it support multiple telephone formats and not just North American.

This webpage might be a helpful guide https://developers.google.com/style/phone-numbers.

thucpn commented 3 years ago

I with make a common input component with pattern prop to validate any other things. Example:

r4pt0s commented 3 years ago

@thucpn Go for it 💪🏻

thucpn commented 3 years ago

@r4pt0s I have made a PR for this issue: https://github.com/zero-to-mastery/WebBlocks/pull/38