You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I discovered this when I was trying to write a custom Phone Number formatter using (NPA) NXX-xxxx format. Using a prefix, in this case '(' and a default value on the input element causes a strange issue where it drops the second character.
Guess you can do like this: https://jsfiddle.net/nosir/aoy6o9h9/
Just bear in mind that prefix is counted as part of raw value, so if you are setting the default value attr, you will need to include '(' as well.
Basically, your requirement is beyond the basic options cleave supports. But still, by doing so as in the fiddle, the formatter itself works fine. The only thing is when you call cleave.getRawValue(), you will need to strip the prefix '(' manually.
Will close this, let me know if you have any problem.
I discovered this when I was trying to write a custom Phone Number formatter using (NPA) NXX-xxxx format. Using a prefix, in this case '(' and a default value on the input element causes a strange issue where it drops the second character.
jsFiddle: https://jsfiddle.net/1notekwr/
The text was updated successfully, but these errors were encountered: