thegamenicorus / react-native-phone-input

Phone input box for React Native
https://www.npmjs.com/package/react-native-phone-input
MIT License
395 stars 449 forks source link

maxlength support #151

Open arthedza opened 3 years ago

arthedza commented 3 years ago

For example:

<PhoneInput
    maxLength={14}
    ...
SirPhemmiey commented 3 years ago

Hey @arthedza did you find a fix for this?

arthedza commented 3 years ago

Hey @arthedza did you find a fix for this?

No, but I've found a PR for maxLength support.

andrushkodmytro commented 2 years ago

Hi. You can pass maxLength in textProps. <ReactNativePhoneInput ref={inputRef} initialValue={value} style={input} offset={30} textStyle={textStyle} initialCountry={'no'} textProps={maxLength: 10} onPressFlag={() => { handleOpenDropdown(); }} onChangePhoneNumber={onChangePhoneNumber}

bharvadiyavishal commented 2 years ago

not working

bharvadiyavishal commented 2 years ago

how can i maxlength(10) in react-native-phone-number-input.

marquinmpfs commented 1 year ago

You can use a prop:

textInputProps={{ maxLength: 12 }}

codegien commented 1 year ago

This works

codegien commented 1 year ago

This works: textInputProps={{maxLength: 12}}