Each individual item cannot be accessed separately in the dropdown component for iOS
Opened this issue · 2 comments
I have the same issue described in Cannot set the locator strategy for the list in the dropdown component for iOS
#124,
I tried the code you provided, but the dropdown items are still grouped together. What I need is each individual item accessed separately. My react-native-element-dropdown package version is V2.12.1
Your example code"
import React, { useState } from 'react';
import { Dropdown } from 'react-native-element-dropdown';
import { StyleSheet, scale } from 'react-native-size-scaling';
const data = [
{ label: 'Item 1', value: '1', itemAccessibility: 'item1' },
{ label: 'Item 2', value: '2', itemAccessibility: 'item2' },
{ label: 'Item 3', value: '3', itemAccessibility: 'item3' },
{ label: 'Item 4', value: '4', itemAccessibility: 'item4' },
{ label: 'Item 5', value: '5', itemAccessibility: 'item5' },
{ label: 'Item 6', value: '6', itemAccessibility: 'item6' },
{ label: 'Item 7', value: '7', itemAccessibility: 'item7' },
{ label: 'Item 8', value: '8', itemAccessibility: 'item8' },
];
const DropdownComponent = () => {
const [value, setValue] = useState(null);
return (
<Dropdown
style={styles.dropdown}
placeholderStyle={styles.placeholderStyle}
selectedTextStyle={styles.selectedTextStyle}
inputSearchStyle={styles.inputSearchStyle}
iconStyle={styles.iconStyle}
data={data}
search
maxHeight={scale(200)}
labelField="label"
valueField="value"
placeholder="Select item"
searchPlaceholder="Search..."
value={value}
accessibilityLabel={'dropdown'}
itemAccessibilityLabelField="itemAccessibility"
onChange={item => {
setValue(item.value);
}}
/>
);
};
export default DropdownComponent;
const styles = StyleSheet.create({
dropdown: {
marginTop: 36,
height: 50,
borderBottomColor: 'gray',
borderBottomWidth: 0.5,
},
icon: {
marginRight: 5,
},
placeholderStyle: {
fontSize: 16,
},
selectedTextStyle: {
fontSize: 16,
},
iconStyle: {
width: 20,
height: 20,
},
inputSearchStyle: {
height: 40,
fontSize: 16,
},
});
I have the same issues, itemTestIDField
is pretty useless, just doesn't work for iOS
i have same issue anyone found solution