Comments (10)
initialRenderIndex
only works with initial mount. That's the way it was designed. I think you can easily achieve your case by using scrollToIndex
. initialRenderIndex
is helpful in cases of initial mount where you don't want any flickers.
from recyclerlistview.
How about that other problem that I'm showing in my snack, where the scroll position is maintained when the over all height of the all rows is smaller?
from recyclerlistview.
I'm not able to repro that. Any hints?
from recyclerlistview.
I just noticed that it's working on my android phone but not on the iPhone simulator. Load the snack and you'll see that it loads a 100 rows with an initial render index of 20. Tap on "Change Rows" which change the content to 10 rows. You'll notice that the scroll position is way below the last item in the list. If you touch the RecyclerListView, it will scroll up to the last item of the list.
from recyclerlistview.
That explains why it wasn't happening for me on android. I really wouldn't want to put a hack to fix it for iOS. Btw does an extra setState fixes it? How about a programmatic one pixel scroll?
from recyclerlistview.
Programmatic scrolling doesn't work, I'm afraid. I even tried getCurrentScrollOffset()
and it's returning the wrong offset. Looks like the height of the listview is being updated on scroll or something.
Another setState
just update the rows, but the scroll position is never updated until you manually scroll inside of the listview.
Check out this example where I'm changing rows from 100 to 25, with an initialRenderIndex of 20.
https://snack.expo.io/HJc3h02kM
from recyclerlistview.
Data Provider change immediately causes a change in height since a request layout immediately happens in the layout manager. This seems to be an iOS thing. I don't have time to look into this right now. Will appreciate if you can dig deep otherwise, I'll come back to this later.
from recyclerlistview.
A little bit of a late reply, but I've just had the same problem with the normal ScrollView on iOS. React native doesn't update the scroll position when the content of the scroll view change and it becomes smaller. Just thought I'd share this obvious observation.
from recyclerlistview.
Thanks for the update! Did you raise an issue with RN? If you did reference it here.. I might ask our iOS team to look into the RN issue
from recyclerlistview.
Closing dude to lack of activity.
from recyclerlistview.
Related Issues (20)
- Unable to change width when the screen oriantation change HOT 2
- Version 4.2.0 increases blank views HOT 2
- forceNonDeterministicRendering is not working when using different View_Types
- The focused row index is different from onVisibleIndicesChanged HOT 1
- Support for multiple viewability config
- 🅱️ Horizontal List Bug (Layout Problem for height not updated correctly) HOT 1
- `testID` & `accessibilityLabel` properties are not supported on recyclerlistview and it's elements?
- numColumns BUG HOT 5
- can not hide the scroll bar HOT 1
- Internal length of list? HOT 1
- compile error
- Recycerlistview renderItem function is rendering half of the item
- How can i render kind of skeleton placeholder items instead of whitespaces/blank?
- TouchableHighlight object inside a RecyclerListView Losing Focus on fast key navigation with React Native TVOS
- How can I interact with the latest selected row?
- Glitch issue when use ScrollViewWithHeader with GridLayoutProvider HOT 1
- useBottomSheetDynamicSnapPoints is deprecated
- Somebody help me!!! /core/RecyclerListView.js: Property id of VariableDeclarator expected node to be of a type ["LVal"] but instead got "BooleanLiteral" HOT 2
- npm run build is failing HOT 3
- Web accessibility: focus order is wrong.
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from recyclerlistview.