react-native-picker-select icon indicating copy to clipboard operation
react-native-picker-select copied to clipboard

.togglePicker() is not working on android

Open romanmatus opened this issue 1 year ago • 3 comments

.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. image

To Reproduce
Steps to reproduce the behavior:

  1. .togglePicker() is working, but it is not oppening anything

Expected behavior
If i press inside blue rectangle, it should open picker select

Screenshots
image

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>

romanmatus avatar Jul 24 '23 13:07 romanmatus

I'm having the same problem. Did you find a work-around?

focux avatar Nov 03 '23 16:11 focux

I am also facing the same issue. How much time it will take to fix this?

satanand7 avatar Nov 04 '23 06:11 satanand7

Have you tried setting fixAndroidTouchableBug to true? Seems to work for me.

adrianso avatar Nov 20 '23 00:11 adrianso

@adrianso no, it does not work. any workaround for this?

dzpt avatar Jul 15 '24 09:07 dzpt

#22

lfkwtz avatar Aug 12 '24 17:08 lfkwtz