Closed Bilal-Abdeen closed 2 weeks ago
I'm facing same issue, even after adding a description many people just add the zero, I made a work around by adding an extra mask for a list of countries I'm facing issue with, then validates the output before submitting and removing the 0 if the country code matches a number in this list.
Same discurssion in https://github.com/AstrOOnauta/react-native-international-phone-number/issues/58
Thank you for the excellent library.
I wonder if it is at all possible to add a customMask that allows phone numbers with and without a prefix of a zero? I tried the following but it did NOT work. It seems that the library's mask can only separate digits with spaces. It would be great if it could consider the value entered.
The above mask should allow ONLY: "04## ### ###" and "4## ### ###" However, it allows "### ### ###" and "#### ### ###"
Background: In some countries, calling a local mobile phone number requires the use of a zero before the phone number. For example, in Australia, to call a mobile phone number I need to dial
04## ### ###
. While some users realise that they should enter the number without prefixing it with zero, some don't. My code removes the zero before saving it to the db.