hossein-zare / react-native-dropdown-picker

A single / multiple, categorizable, customizable, localizable and searchable item picker (drop-down) component for react native which supports both Android & iOS.
https://hossein-zare.github.io/react-native-dropdown-picker-website/
MIT License
971 stars 295 forks source link

Drop down item becomes un-pressable when wrapping in a view with testID #564

Closed Jad-Jbara closed 2 years ago

Jad-Jbara commented 2 years ago

I have a large pressable container which contains a dropdown that is wrapped in a view. The following works completely fine:

<View style={styles.row}>
            <DropDown
              key={`drop_down_${id}_${myStatus}`}
              items={ITEMS}
              open={isOpen}
              setOpen={setOpen}
              onChangeValue={onValueChange}
              style={styles.dropDown}
              containerStyle={styles.dropDownContainer}
              renderListItem={renderListItem}
            />
            ...
        </View>

However the following causes the drop down item not to be pressable and makes the parent's touchable area have precedence (ie the large pressable container)

<View testID='dropdown_container' style={styles.row}>
            <DropDown
              key={`drop_down_${id}_${myStatus}`}
              items={ITEMS}
              open={isOpen}
              setOpen={setOpen}
              onChangeValue={onValueChange}
              style={styles.dropDown}
              containerStyle={styles.dropDownContainer}
              renderListItem={renderListItem}
            />
        </View>
hossein-zare commented 2 years ago

See: https://github.com/hossein-zare/react-native-dropdown-picker/issues/450#issuecomment-976497649 and https://github.com/hossein-zare/react-native-dropdown-picker/issues/376