Setting the index of the item to be displayed does not work
See original GitHub issueHey @kkemple
Thanks for the great and simple library. I managed to get working for one of my project without any problem (once I had read #23 that is 😃)
I found an issue when setting the index of the item to be rendered first. It really only works when setting the value is equal to 0.
I have created a snack to reproduce the issue. Basically I am displaying a bunch of text in a view
const data = [
{ text: 'THIS IS TEXT 0' },
{ text: 'THIS IS TEXT 1' },
{ text: 'THIS IS TEXT 2' },
{ text: 'THIS IS TEXT 3' },
{ text: 'THIS IS TEXT 4' }
];
and setting the item to be displayed first to entry 3
<SideSwipe
index={3}
...
What’s happening is that THIS IS TEXT 0
shows up on screen first. As soon as I start swiping, even by the slightest swipe movement, the text updates to THIS IS TEXT 3
as expected.
To reproduce:
- Load snack
- Start swiping
Observe text changing from THIS IS TEXT 0
to THIS IS TEXT 3
Issue Analytics
- State:
- Created 6 years ago
- Comments:18 (8 by maintainers)
Top Results From Across the Web
4 reasons your z-index isn't working (and how to fix it)
1. Elements in the same stacking context will display in order of appearance, with latter elements on top of former elements. · 2....
Read more >Why does z-index not work?
The z-index property only works on elements with a position value other than static (e.g. position: absolute; , position: relative; ...
Read more >CSS Z-Index Not Working? How to Fix It Using Stack Order
The z-index property of CSS is a tricky one. It won't work easily by itself if you don't know how to use it...
Read more >Why your z-index isn't working
I was building a sidebar recently, and I encountered a bug where the content of the page was always on top of the...
Read more >CSS Z-Index Not Working! Send Help!
TL;DR: the most common cause for z-index not working is not explicitly declaring a CSS position value (i.e. position: relative, absolute, fixed ...
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 fixed this… A little confused over the other branch…
Just put:
initialScrollIndex={currentIndex}
anywhere in the <AnimatedFlatList (line 127 is where I put it.
Works perfectly…
Much simpler than flatlist… Thanks… Have same issue with the starting index though… Thanks Kurtis!