thegamenicorus / react-native-phone-input

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

maxlength support #151

Open arthedza opened 4 years ago

arthedza commented 4 years ago

For example:

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

Hey @arthedza did you find a fix for this?

arthedza commented 4 years ago

Hey @arthedza did you find a fix for this?

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

andrushkodmytro commented 3 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 2 years 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}}