AstrOOnauta / react-native-international-phone-number

⚛️ International mobile phone number input component for React Native 📱
https://snack.expo.dev/@astroonauta/react-native-international-phone-number
ISC License
272 stars 45 forks source link

Suggestion: maxLength for Phone Number Input #6

Closed KushaanKapoor closed 1 year ago

KushaanKapoor commented 1 year ago

HI, I really like this library, but I cannot find the option to increase the number of digits as input available.

Since there are alot of countries that accept 11 numbers and more, rather than 10. this seems like an issue which users might face when trying to enter their phone number for authentication.

I would like to increase the number of digits accepted in the phone number input.

AstrOOnauta commented 1 year ago

Hello @KushaanKapoor

Can you talk more about this? Which countries? Any country that the lib dont masked correct? There are (in this lib) countries with a wide variety of digits in the mask (at least one mask with 10 or more), like China with 3 masks: '### #### ###' (10digits), '### #### ####' (11digits) or '## ##### #####' (12 digits), Germany with 6 masks: '### ###', '### ## ##', '### ## ###', '### ## ####', '### ### ####' (10 digits) or '#### ### ####' (11 digits), etc...

if this is still a problem, let me know and how to improve. Unfortunately I cannot add an option to choose the input length (not for now), because this breaks the mask idea.

🚀 AstrOOnauta 🚀

KushaanKapoor commented 1 year ago

then maybe if we can give a custom mask? for example, in India most of the numbers are 10 digits, but some of them are also 11. Also, I would like to mask it differently. for example, ['## ## ## ####'] or so on.. I have created a PR. please see and let me know! thanks for a fast reply!

AstrOOnauta commented 1 year ago

Hey @KushaanKapoor !

I see your PR about this discussion and I apreciate it. So, I realease a new version with your contribute.

Please, update your react-native-international-phone-number lib to version 0.4.15 and enjoy!

Thanks, 🚀 AstrOOnauta 🚀

Kushaan-Kz commented 1 year ago

That's great! Thanks a lot @AstrOOnauta. I look forward to this library.