Description
I am using a dropdown for the country data and it contains more than 150 data, without search, it is working fine but with search it is throwing error of " Invariant Violation: scrollToIndex out of range: requested index 101 is
out of 0 to 36 "
import { Dropdown } from 'react-native-element-dropdown';
import { ScrollView, Text, TextInput, View } from 'react-native';
return (
<Text style={[styles.regularText, styles.f15]} numberOfLines={1}>
Country/Region
<Dropdown
style={[styles.dropdown, styles.lightText]}
data={allCountries}
labelField="label"
valueField="label"
placeholder="Select Country"
value={country}
onChange={(item) => {
setcountry(item.label);
}}
renderItem={_renderItem}
selectedTextStyle={[styles.selectedText, styles.mediumText]}
placeholderStyle={[styles.selectedText, styles.mediumText]}
maxHeight={300}
search
autoScroll={true}
searchPlaceholder="Search..."
inputSearchStyle={{ height: 40, fontSize: 13, }}
iconColor={colors.primary}
/>
{/* <Text style={[styles.regularText, styles.errorTextStyle]}>Error message</Text> */}
</View>