firstItem not working on Android
See original GitHub issueIs this a bug report, a feature request, or a question?
bug report
Have you followed the required steps before opening a bug report?
- [x ] I have read the guidelines regarding bug report.
- [ x] I have reviewed the documentation in its entirety, including the dedicated documentations 📚.
- [ x] I have searched for existing issues and made sure that the problem hasn’t already been reported.
- [ x] I am using the latest plugin version.
- [ x] I am following the issue template closely in order to produce a useful bug report.
Have you made sure that it wasn’t a React Native bug?
yes
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
Environment
Environment: React: 16.0.0-beta.5 React native: 0.51 react-native-snap-carousel: 3.3.4
Target Platform: Android (6.0) iOS (11) –>
(Write your answer here.)
Expected Behavior
scroll to item number specified in firstItem
Actual Behavior
does not scroll
Reproducible Demo
- use firstItem on android.
This might be related to https://stackoverflow.com/questions/33208477/react-native-android-scrollview-scrollto-not-working
I fixed it when using scrollTo in my component in a hacky way by introducing a 200ms delay or so on android.
Issue Analytics
- State:
- Created 5 years ago
- Reactions:4
- Comments:9 (2 by maintainers)
Top Results From Across the Web
firstItem not working · Issue #63 · meliorence/react-native-snap ...
Hey, I'm having an issue with setting firstItem. Most of the time, the wrong item is selected. We are using a function which...
Read more >Why is the first item in the Spinner not working - Stack Overflow
ArrayAdapter aa = new ArrayAdapter(this,R.layout.languagespinner,countries); aa.setDropDownViewResource(android.R.layout.
Read more >Change Switch Access settings - Android Accessibility Help
Open your device's Settings app . Open Accessibility and then Switch Access and then Settings. Assign switches for scanning. When you set up...
Read more >Lists and grids | Jetpack Compose - Android Developers
By default, each item's state is keyed against the position of the item in the list or grid. However, this can cause issues...
Read more >RecyclerView Recipes: Snap to first item - ProAndroidDev
It's also the first article in a series about the not so trivial RecyclerView ... The latest posts from Android Professionals and Google...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Hey @eoghanmccarthy please use useScrollView into your Carousel component, it will solve your problem.
<Carousel data={photos} renderItem={this._renderItem} sliderWidth={sliderWidth} itemWidth={itemWidth} firstItem={this.state.selectedIndex} contentContainerCustomStyle={styles.sliderContentContainer} layout={"default"} loop={true} onSnapToItem={slideIndex => this.setState({ selectedIndex: slideIndex }) } useScrollView />
Sorry, please allow me to advertise for my open source library! ~ I think this library react-native-reanimated-carousel will solve your problem. It is a high performance and very simple component, complete with React-Native reanimated 2