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

Bug with Russian number

Open umutayyildizli opened this issue 3 years ago • 6 comments

umutayyildizli avatar Sep 23 '21 12:09 umutayyildizli

When number is 8 (964) 534-35-44 and i delete last symbol it becomes 8 (896) 453-43-54 One more 8 added, and it's really strange

umutayyildizli avatar Sep 23 '21 12:09 umutayyildizli

same issue

a-mann avatar Oct 19 '21 12:10 a-mann

same issue +1

ack79 avatar Nov 04 '21 06:11 ack79

+1

vlad909 avatar Nov 08 '21 14:11 vlad909

+1`

BEARlogin avatar Dec 03 '21 18:12 BEARlogin

It because of replaced awesome-phonenumber lib to libphonenumber-js So i used some workaround

valueMutator: ({ ref, inputVal }) => {
        if (!ref.phoneObject.valid) {
          return
        }
        const result = new PhoneNumber(inputVal, ref.phoneObject.countryCode)
        if (!result.isValid()) {
          data.value.user.phone.local = inputVal
          return
        }

        data.value.user.phone.international = result.getNumber('international')

        return result.getNumber('national')
}

BEARlogin avatar Dec 03 '21 19:12 BEARlogin