react-native-picker-select
react-native-picker-select copied to clipboard
.togglePicker() is not working on android
.togglePicker() is not working on android but on iOS is working fine
This works perfectly on ios, but on android it is working only if you press inside red square, but i need it work if i press inside blue rectangle as on image below.
To Reproduce
Steps to reproduce the behavior:
-
- .togglePicker() is working, but it is not oppening anything
Expected behavior
If i press inside blue rectangle, it should open picker select
Screenshots
Additional details
- Device: [Pixel 3a]
- OS: [Android 14]
- react-native-picker-select version: [8.0.4]
- react-native version: [0.72.3]
- expo sdk version: [49.0.3]
Reproduction and/or code sample
const handlePickerToggle = () => {
if (dropDownRef.current) {
if (Platform.OS === 'android') {
dropDownRef.current.togglePicker();
console.log("iam here")
}
else{
dropDownRef.current.togglePicker();
}
}
};
<TouchableOpacity className="bg-blue-200" onPress={handlePickerToggle}>
<View className="h-full flex-row items-center">
<Image
className="h-6 w-6 mr-2 ml-2"
source={getImageSource(nationalPrefix)}
/>
<DropDown
ref={dropDownRef}
fixAndroidTouchableBug={true}
useNativeAndroidPickerStyle={false}
placeholder={{
label: "USA",
value: "+1",
inputLabel: "+1",
}}
onValueChange={(value) => {
setNationalPrefix(value);
handleValueChange();
}}
style={pickerStyle}
items={[
{ label: "Australia", value: "+61", inputLabel: "+61" },
{ label: "UK", value: "+44", inputLabel: "+44" },
]}
/>
<Feather
className="ml-2 mr-2"
name={"chevron-down"}
size={20}
color="#899295"
/>
</View>
</TouchableOpacity>
I'm having the same problem. Did you find a work-around?
I am also facing the same issue. How much time it will take to fix this?
Have you tried setting fixAndroidTouchableBug
to true? Seems to work for me.
@adrianso no, it does not work. any workaround for this?
#22