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

firstItem does not work with Android. #302

Closed
cyphire opened this issue Apr 7, 2018 · 1 comment
Closed

firstItem does not work with Android. #302

cyphire opened this issue Apr 7, 2018 · 1 comment

Comments

@cyphire
Copy link

cyphire commented Apr 7, 2018

Is this a bug report or a feature request?

Bug Report

Have you read the guidelines regarding bug report?

Yes

Have you read the documentation in its entirety?

Yes

Have you made sure that your issue hasn't already been reported/solved?

I didn't see it anywhere, other than the reference to the instability of the indexing on Android.

Is the bug specific to iOS or Android? Or can it be reproduced on both platforms?

Android

Is the bug reproductible in a production environment (not a debug one)?

Yes - built it in production mode.

Have you been able to reproduce the bug in the provided example?

No. I would wonder if there were many people with the problem but with gitHub not providing any feedback loop other than creating a issue, there doesn't seem to be any way to know if it was a mistake using this repository. I've used 4 different sliders like this, only this one seems not to use the native built in indexing but use a calculated offset. Since it works on the first 10 or so items in my array, but not on any further down the list, I am sure that this is a problem with the way the firstItem is being calculated and if so - should be a warning to only use this for iOS.

Environment

Environment:
React: 16.0.0
React native: 0.51
react-native-snap-carousel: 3.6.0

Target Platform:
Android (API 27)

Steps to Reproduce

  1. First small number of items will correctly pick the correct item.
  2. Anything about 20 or so items in the array will NOT start with the correct index.

Expected Behavior

I expected when I send an array of data to the carousel that it would start at the correct item in the array. It does not. It does not work in production either. I would love to know if this is a known bug or issue.

Actual Behavior

Very simple. Does NOT go to the index as sent in.

Reproducible Demo

				<Carousel layout={'default'}
					ref={(c) => { this._carousel = c; }}
					data={this.state.theData}
					firstItem={this.state.full_page_index}
					renderItem={(item, index) => this._renderItem(item, index)}
					sliderWidth={this.sn.tw}
					itemWidth={this.sn.height3}
					onSnapToItem={index => {
						this.setState({full_page_index: index}, 
							this._setNavigationParams(item.id));
			
					}}
					hasParallaxImages={true}
				/>
@bd-arc
Copy link
Contributor

bd-arc commented Apr 8, 2018

@cyphire This is an unfortunate FlatList bug that has been referenced in #63, #159, #235, #261 and #288.

Take a look at this comment to learn more about the exact matter and to find out potential workarounds.

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

No branches or pull requests

2 participants