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

Each individual item cannot be accessed separately in the dropdown component for iOS #297

Open
Wei92620 opened this issue Sep 6, 2024 · 1 comment

Comments

@Wei92620
Copy link

Wei92620 commented Sep 6, 2024

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,
},
});

image

@a8trejo
Copy link

a8trejo commented Nov 14, 2024

I have the same issues, itemTestIDField is pretty useless, just doesn't work for iOS

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