Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

spaces and dashes are not removed from input #147

Open
szabinagy opened this issue Feb 24, 2022 · 1 comment
Open

spaces and dashes are not removed from input #147

szabinagy opened this issue Feb 24, 2022 · 1 comment

Comments

@szabinagy
Copy link

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!

@tanansatpal
Copy link
Owner

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants