Skip to content

Invariant Violation: scrollToIndex out of range: requested index 101 is out of 0 to 36 #22

Closed
@govindshah62

Description

@govindshah62

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>

)
WhatsApp Image 2021-11-27 at 11 24 44 AM

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions