Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

maxlength support #151

Open
arthedza opened this issue Aug 13, 2020 · 8 comments
Open

maxlength support #151

arthedza opened this issue Aug 13, 2020 · 8 comments

Comments

@arthedza
Copy link

For example:

<PhoneInput
    maxLength={14}
    ...
@SirPhemmiey
Copy link

Hey @arthedza did you find a fix for this?

@arthedza
Copy link
Author

arthedza commented Sep 1, 2020

Hey @arthedza did you find a fix for this?

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

@andrushkodmytro
Copy link

andrushkodmytro commented Nov 3, 2021

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
Copy link

not working

@bharvadiyavishal
Copy link

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

@marquinmpfs
Copy link

You can use a prop:

textInputProps={{ maxLength: 12 }}

@codegien
Copy link

This works

@codegien
Copy link

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants