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
279 stars 52 forks source link

maxLength input #16

Closed arirah closed 1 year ago

arirah commented 1 year ago

How to re set maxLength ?

arirah commented 1 year ago

Ok found the solution customMask={['#### #####', '##### #####']}`

But need more specific details here

AstrOOnauta commented 1 year ago

Hey @arirah

You can use the normal textInput prop maxLength to do this. Check the example:

<PhoneInput
          value={inputValue}
          onChangePhoneNumber={setInputValue}
          selectedCountry={selectedCountry}
          onChangeSelectedCountry={setSelectedCountry}
          maxLength={4}   <--- ADD THIS
        />

🚀 AstrOOnauta 🚀

arirah commented 1 year ago

Hey @arirah

You can use the normal textInput prop maxLength to do this. Check the example:

<PhoneInput
          value={inputValue}
          onChangePhoneNumber={setInputValue}
          selectedCountry={selectedCountry}
          onChangeSelectedCountry={setSelectedCountry}
          maxLength={4}   <--- ADD THIS
        />

🚀 AstrOOnauta 🚀

You are right !