Open Claire-Bear opened 2 years ago
Validation should be shown to the user on invalid number formats
Relevant code:
As per the comments, we almost certainly want to replace this with something libphonenumber
based that parses and validates the number to E.164 at entry time.
I didn't find a purpose-made Angular widget with a cursory search, so we may just want to pull in libphonenumber-js and hook that into the existing Angular form validation.
@PiDelport, would somehting like this: How to add Angular phone number format, work?
Maybe, though that seems to use the heavier-weight google-libphonenumber
port, rather than libphonenumber-js
. I'm also wary of that widget's UI styling not necessarily working with our app; particularly, the fact that it seems to be based on ngx-bootstrap
.
Googling a bit more, maybe this is worth a try? https://github.com/azzamasghar1/ion-intl-tel-input
Thanks Pi! Checking it now. Quick question: are the forms we use template-driven or reactive?
Reactive.