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

Getting Scroll to index error #263

Open
KerryDss opened this issue Aug 9, 2021 · 3 comments
Open

Getting Scroll to index error #263

KerryDss opened this issue Aug 9, 2021 · 3 comments

Comments

@KerryDss
Copy link

KerryDss commented Aug 9, 2021

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.

@KerryDss KerryDss changed the title Getting Scroll to index error. Getting Scroll to index error Aug 9, 2021
@van1985
Copy link

van1985 commented Oct 22, 2021

Any news about this issue? I have experimenting the same issue :(

@trusasha
Copy link

Try to add prop saveScrollPosition={false} to ModalDropdown
This work for me (1.0.1 version)

@HammadAhm3d
Copy link

Try to add prop saveScrollPosition={false} to ModalDropdown
This work for me (1.0.1 version)

Thanks. Worked for me too.

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

4 participants