vue-tel-input icon indicating copy to clipboard operation
vue-tel-input copied to clipboard

Vue3 beta.4 not validating mobile number

Open keziakoko opened this issue 2 years ago • 3 comments

Hi, I came across an issue with the validation in the vue 3 version. The mobile number is not being validated when typing - I am able to enter letters and other characters. If you change the country it validates it though.

Not validated: image

Change country then it is validated, invalid characters are removed and it is reformatted to the correct format: image

My settings object which I declare in my main.js looks like this:

const vueTelInputOptions = { mode: "international", defaultCountry: "ZA", enabledCountryCode: true, preferredCountries: ["ZA", "NA"], validCharactersOnly: true, autocomplete: "off", dropdownOptions: { showDialCodeInList: true, showDialCodeInSelection: true, showFlags: true }, inputOptions: { placeholder: "Enter Mobile Number", required: false } };

keziakoko avatar Sep 02 '21 15:09 keziakoko

@keziakoko I have the same issue, did you manage to fix it somehow? Something I noticed is, vue-tel-input works fine on firefox, on Chromium based browsers it has the same problem you described.

emanuellopess avatar Nov 16 '21 16:11 emanuellopess

@emanuellopess I did not manage to fix it. I ended up adding in my own validation in an off focus event on the input. It appears to be working on my firefox as well, however I can still enter invalid characters, it does put it in the correct format with the correct prefix though.

Hoping to get a resolution on this...

keziakoko avatar Nov 24 '21 14:11 keziakoko

Yes i am also experiencing the same. the library is not validating on typing , and it also accepts other characters image

vmisiko avatar Jul 24 '23 13:07 vmisiko