Skip to content

Getting Scroll to index error  #263

Description

@KerryDss

Hi,
I am getting this error from basic implementation .

Here is the error

Invariant Violation: scrollToIndex should be used in conjunction with getItemLayout or onScrollToIndexFailed, otherwise there is no way to know the location of offscreen indices or handle failures.

Here is the screen shot

Simulator Screen Shot - iPhone 12 - 2021-08-09 at 14 23 09

Here is the code

<SafeAreaView>
<View>
        <Text style={{position: 'absolute', top: 40, left: 20}}>
           Shop By :
         </Text>
                <ModalDropdown
                  style={{
                    marginTop: 30,
                    borderWidth: 1,
                    paddingVertical: 8,
                    // paddingLeft: 12,
                    borderRadius: 12,
                    borderColor: 'grey',
                  }}
	        textStyle={[globalStyle.boldedFont, globalStyle.normalText, {paddingLeft: 86}]}
                  defaultValue=" "
                  dropdownStyle={{
                    width: windowWidth - 32,
                    height: 70,
                    marginLeft: -2,
                  }}
                  options={['Top Brands', 'Brands with Promotions']}
                />
        </View>
</SafeAreaView>

This error occur when you try to change the value multiple times.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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