I used the ngx-mat-intl-tel-input in a reactive form.
After submitting the form I call reset(currentFormValue) on the formGroup, so the form state must be reset with the given values.
In the ngx-mat-intl-tel-input the selected country is Switzerland and the value is 745557 --- 966 ---. This is valid, and after the form reset it remains like this. The model value is correct +41745557966 but the input shows with spaces and dashes.
So you can add spaces and dashes everywhere in the input without any issues, after you entered a correct phone number.
Can you please display the model value in the input field after blur event or something like that?
Thanks!
Hi @szabinagy, this library depends on libphonenumber-js which returns the proper numberInstance even if it contains dashes and spaces.
This is something that can't be handled in here
I used the
ngx-mat-intl-tel-input
in a reactive form. After submitting the form I callreset(currentFormValue)
on the formGroup, so the form state must be reset with the given values. In thengx-mat-intl-tel-input
the selected country is Switzerland and the value is745557 --- 966 ---
. This is valid, and after the form reset it remains like this. The model value is correct+41745557966
but the input shows with spaces and dashes. So you can add spaces and dashes everywhere in the input without any issues, after you entered a correct phone number. Can you please display the model value in the input field after blur event or something like that? Thanks!