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

How to make the height of country picker longer? #123

Open
felixchan opened this issue Oct 9, 2019 · 5 comments
Open

How to make the height of country picker longer? #123

felixchan opened this issue Oct 9, 2019 · 5 comments

Comments

@felixchan
Copy link

Seems that it only fills 1/3 of the screen. Is there any way to customize the height of the scroll picker?

@ncuthbert
Copy link

ncuthbert commented Nov 1, 2019

If it helps, I used react-native-country-picker-modal which I found easier to customise, and display that in onPressFlag. In the country picker's onChange, I call this.phoneInput.selectCountry(country.cca2.toLowerCase() to set the country on the phone input. Works well for me.

@m4manjesh
Copy link

@ncuthbert I am getting this "undefined is not an object (evaluating '_this.countryPicker.openModal')" while using react-native-country-picker-modal?

componentDidMount() {
this.asyncLoadLastPhone();
this.setState({
pickerData: this.phone.getPickerData(),
});
}

onPressFlag = () => {
this.countryPicker.openModal();
};

selectCountry = (country: any) => {
this.phone.selectCountry(country.cca2.toLowerCase());
this.setState({cca2: country.cca2});
};

<PhoneInput
style={styles.PhoneInput}
textStyle={styles.PhoneInputText}
autoFormat={true}
value={phoneStr}
initialCountry={cca2}
onPressFlag={this.onPressFlag}
ref={ref => {
this.phone = ref;
}}
/>
<CountryPicker
ref={ref => {
this.countryPicker = ref;
}}
onChange={value => this.selectCountry(value)}
translation="eng"
cca2={this.state.cca2}>


@ncuthbert
Copy link

@m4manjesh looks like there is a ticket open for the issue you describe. Seeing as it's come up recently for a number of people, it may be related to a recent version and I'd suggest downgrading, if possible.

@m4manjesh
Copy link

@ncuthbert Thanks for the response. Which version you are using?

@ncuthbert
Copy link

I'm using 0.2.2 at the moment. There was another issue in 0.2.4, so I've downgraded as a workaround.

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

3 participants