firstItem not working
See original GitHub issueHey, I’m having an issue with setting firstItem. Most of the time, the wrong item is selected. We are using a function which returns the children, so we got something like this:
<Carousel
ref={'covers'}
sliderWidth={viewportWidth}
itemWidth={240}
inactiveSlideScale={0.9}
inactiveSlideOpacity={0.6}
showsHorizontalScrollIndicator={false}
snapOnAndroid={true}
removeClippedSubviews={false}
onSnapToItem={this.onSnap}
firstItem={8}
>
{this.getCovers()}
</Carousel>
In our case, the 8th item wasn’t selected when the component mounts. If we do something like this:
componentDidMount() {
setTimeout(() => { this.refs.covers.snapToItem(8,false); },500);
}
…the correct item is selected. Are there any issues when generating the childrens via function?
Issue Analytics
- State:
- Created 6 years ago
- Reactions:4
- Comments:16 (8 by maintainers)
Top Results From Across the Web
React Native Snap Carousel - First Item - Stack Overflow
Currently when the carousel loads it loads the first index instead of the one I tell it to with FirstItem. When I refresh...
Read more >Solved - FirstItem not working | OTLand
Hello my firstitems not working, with account menager and without account menager, i cant change eq on samples becouse after relog samples got...
Read more >Solved: The Patch not updating the first item
If you use the ForAll backward, you will suffer high performance issues. ForAll is a function that produces a Table, not a for...
Read more >recyclerview first item does not get focus by default with ...
I tried keeping and removing values 'yes', 'no' or 'auto' importantForAccessbility for Recyclerview in the xml file but nothing solved my issues ......
Read more >Database: Pagination - The PHP Framework For Web Artisans
However, if you do not plan to show the total number of pages in your ... $paginator->firstItem(), Get the result number of the...
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
}
I just had similar issue where the carousel has long list (eg. 90 items) and set the
firstItem
into high number will always select the 12th item. It turns out I have to addgetItemLayout
in order for FlatList to figure out how long the list will be.I hope this helps someone else related to
firstItem
issue.