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

Android back button doesn't dismiss the country picker modal #111

Open
HyuArzani opened this issue Feb 4, 2025 · 1 comment
Open

Android back button doesn't dismiss the country picker modal #111

HyuArzani opened this issue Feb 4, 2025 · 1 comment

Comments

@HyuArzani
Copy link

Hei, is there any way to dismiss the country modal using the Android back button?
`
import { View } from "react-native";
import { useState } from "react";
import PhoneInput from "react-native-international-phone-number";

export const Something = () => {
const [phoneInputValue, setPhoneInputValue] = useState("");
const handlePhoneInputValue = (phoneNumber) => {
setPhoneInputValue(phoneNumber);
};
const [selectedCountry, setSelectedCountry] = useState(null);
const handleSelectedCountry = (country) => {
setSelectedCountry(country);
};

return (
<View
style={{
paddingTop: 5,
paddingBottom: 5,
}}
>
<PhoneInput
language="en"
popularCountries={[
"NL",
"GB",
"US",
"ZA",
"CA",
"AU",
"DE",
"BE",
"FR",
"ES",
"IT",
"PT",
"NZ",
]}
popularCountriesSectionTitle="Suggested"
restOfCountriesSectionTitle="All"
value={phoneInputValue}
onChangePhoneNumber={handlePhoneInputValue}
selectedCountry={selectedCountry}
onChangeSelectedCountry={handleSelectedCountry}
/>

)
}
`

@ricardopacheco
Copy link

Exact the same problem here! Expo SDK 52 with react-native-international-phone-number v04.15. My application is blank yet, so, just create a new expo app com this dependency.

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

2 participants