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

Render First Initial index != 0 #1098

Open
lillogoal opened this issue Oct 31, 2019 · 3 comments
Open

Render First Initial index != 0 #1098

lillogoal opened this issue Oct 31, 2019 · 3 comments
Labels
🔎investigate collect more info

Comments

@lillogoal
Copy link

Which OS ?

Android and maybe too IOS

Version

Which versions are you using:
"react": "16.9.0",
"react-native": "0.61.3",
"react-native-swiper": "1.6.0-rc.3",

Expected behaviour

This is my Component where i use Swiper.
<View style={{ flex: 1 }}>
<Swiper
style={styles.wrapper}
showsButtons={false}
index={1}
ref={(ref: Swiper) => {
this.swiperMain = ref
}}
horizontal={true}
onIndexChanged={index => this.onIndexChanged(index)}
showsPagination={false}
>




I setted initial index = 1 ad it's ok. But when i launch app (in particular in android) i can see before render index = 1, swiper renders index = 0 in my case Profile. I have been looked for solving this problem on github or google but i didn't find anything

I can record a little video if you want

@ArrayZoneYour ArrayZoneYour added the 🔎investigate collect more info label Nov 1, 2019
@lillogoal
Copy link
Author

In this moment i solved using this answer: facebook/react-native#6849 (comment)

But i think the problem is only in Android because not exist a method to set initial position ScrollView

@yelkamel
Copy link

yelkamel commented Nov 14, 2019

"react-native": "0.61.2",
"react-native-swiper": "^1.6.0-rc.3",

Same issue here with Android.
The workarround with the overlay work but need a better solution...

@ChristianChiarulli
Copy link

this only happens when I first map some data to a list of components

{array.map(a => (
          <Text>{a}</Text>
        ))}

If I just pass a bunch of views initially onIndexChange works as expected.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🔎investigate collect more info
Projects
None yet
Development

No branches or pull requests

4 participants