Skip to content

maintainVisibleContentPosition Not Working #547

Open

Description

Current behavior

When a maintainVisibleContentPosition prop is given to a FlashList and items are prepended to the data array, the user sees the list content move. This can be observed in the video below. On the left tab, we have React Native's FlatList, which does not scroll as content is prepended to its data array. On the right tab, we have FlashList, which does scroll as content is prepended, even when providing a valid keyExtractor and a maintainVisibleContentPosition of { minIndexForVisible: 0 }.

maintain-visible-content-position.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 its data and maintainVisibleContentPosition is not undefined.

To Reproduce

https://github.com/nickcherry/flashlist-maintain-visible-content-position

Platform:

  • iOS
  • Android

Environment

1.2.1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

Labels

P1Important but not urgentbugSomething isn't working

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions