-
Notifications
You must be signed in to change notification settings - Fork 343
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
Added mask with place holder functionality #464
base: master
Are you sure you want to change the base?
Conversation
I am updating the functionality to have two new features: Mask AsYouType and Mask w/ Placeholder. The first one uses AsYouTypeFormatted provided within 'google-libphonenumber'. The second type uses the resolvePlaceholder function to get the placeholder and masks the input according to the placeholder. Im adding these functions internally since any changes to the connected FormControl from inside the component trigger an infinite loop of emitted events when dynamically updated FormControl. We have tried avoiding an Emitted Event when updating the value however, since the ngx-int-tel-input component also modifies the ngModel value when it is updated dynamically. There is no way to mask the input without resulting in an infinite loop. |
Kindly assign a reviewer so these changes can be merged. We are currently using this plugin in prod and need this functionality integrated. |
@webcat12345 - I see a PR as a great addition to this amazing library. Can you please fast-track this? |
Okay the last commit will be the last one for this PR. There are bunch of additions in this.
Since we needed this functionality in production, I have uploaded this package to npm : ngx-intl-tel-input-pr-464 @webcat12345, I know this is a pretty heavy PR but it would be great if you could review it and possibly merge it. If there are any questions regarding the reliability of the code, just comment here. Hoping this gets merged soon. |
I faced this issue with this plugin and needed to make the User Experience better. I wanted the input to be masked with the place holder and what Ive added is just that. resolvePlaceholder gets us the place holder, i made a simple algo to convert the phoneNumber to masked phone number and then update the propagated value. Kindly check and see if you can accept this pull request.