Open nickcherry opened 2 years ago
maintainVisibleContent
position is unsupported right now. We will update here once we get to it.
The last missing piece for a almost perfect library :)
+1 we really need maintainVisibleContentPosition
, please
+1 I copy repo and make custom bridge for android :/
+1, extremely valuable prop... would perfect the library!
๐
any workaround?
Hey, I'd like to know the advancement on this feature ? Any news ?
For using flash list to implement messaging interfaces, a workaround is to ignore changes on data passed to FlashList, and not update data unless the the scroll position is within a small distance of the bottom (my list is inverted). This does not exactly reproduce maintainVisibleContentPosition when the list is at the bottom and we update the list, so new messages push the rest of the list up, but it is acceptable for common messaging use cases.
@fortmarek Can you please handle this PR
Any news on this one?
Just ran into this myself. Might need to revert to FlatList
. Would be grateful if anyone is able to work on this feature.
FlashList as of now does not support the maintainVisibleContentPosition
prop or similar functionality.
For those of you who may need similar functionality, I've published an analysis of this problem and a patch to solve it here; feel free to test it out.
Note that instead of attempting to replicate ScrollView's maintainVisibleContentPosition
prop, my patch creates a new prop preserveVisiblePosition
instead.
Hey team, any updates on this issue? I see there is a fix about an experimental feature supporting MVCP from discord forked repo. Can't we merge it into this? ๐
Hey team, any updates on this issue? I see there is a fix about an experimental feature supporting MVCP from discord forked repo. Can't we merge it into this? ๐
Can you share the fork link @Marvin-Bai
Hey team, any updates on this issue? I see there is a fix about an experimental feature supporting MVCP from discord forked repo. Can't we merge it into this? ๐
Can you share the fork link @Marvin-Bai
Here it is. https://github.com/discord/flash-list
If what you're referring to is this branch, the commits appear to be just a squash of this PR, which for the reasons I explain in the link from my above comment, cannot fully solve the issue (with problems like not working well during scrolling and not working if the indexes shift too much).
See if my linked fork/patch works well for you, and if it does, it would be great if you added support for my PR to get thoughts and attention of the maintainers.
P.S. With respect to the two flaws I specifically linked to, my fork/patch addresses it respectively in:
Mechanism -> Details -> 'Refixing' -> Timing
section (_queueLayoutRefix
in the recyclerlistview
code)Mechanism -> Details -> List changes
section (handleDatasetChange
in the recyclerlistview
code)Besides these two flaws, my patch addresses a good deal of other edge cases; in the latter part of my explainer, essentially each section corresponds to the presence of an edge case, and how we have dealt with/can deal with it properly.
Would be amazing to get this ๐ฅฒ
Any news on this ?
Current behavior
When a
maintainVisibleContentPosition
prop is given to aFlashList
and items are prepended to thedata
array, the user sees the list content move. This can be observed in the video below. On the left tab, we have React Native'sFlatList
, which does not scroll as content is prepended to itsdata
array. On the right tab, we have FlashList, which does scroll as content is prepended, even when providing a validkeyExtractor
and amaintainVisibleContentPosition
of{ minIndexForVisible: 0 }
.https://user-images.githubusercontent.com/229477/182754997-24c6ceaf-bb7f-481e-873d-5d65e2202862.mov
See https://github.com/nickcherry/flashlist-maintain-visible-content-position for reproducible demo.
Expected behavior
I would expect FlashList to behave like
FlatList
and not scroll when content is prepended to itsdata
andmaintainVisibleContentPosition
is notundefined
.To Reproduce
https://github.com/nickcherry/flashlist-maintain-visible-content-position
Platform:
Environment
1.2.1