Skip to content

onViewableItemsChanged is triggered when initialScrollIndex set #1943

@f0wu5u

Description

@f0wu5u

Description

We are currently migrating from v1 to v2, and we found out that the onViewableItemsChanged is triggered on mount if we provide initialScrollIndex and does not respect the viewabilityConfig.waitForInteraction. This was not the case with v1 or FlatList

Current behavior

onViewableItemsChanged is triggered on mount if we provide initialScrollIndex and does not respect the viewabilityConfig.waitForInteraction

Expected behavior

onViewableItemsChanged should not be triggered on mount if we provide initialScrollIndex and the viewabilityConfig.waitForInteraction=true

Reproduction

Expo Snack or minimal reproduction link:

Platform

  • iOS
  • Android
  • Web (if applicable)

Environment

React Native info output:
Paste output here

FlashList version: 2.1.0

Additional context

Checklist

  • I've searched existing issues and couldn't find a duplicate
  • [] I've provided a minimal reproduction (Expo Snack preferred)
  • I'm using the latest version of @shopify/flash-list
  • I've included all required information above

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions