Skip to content

FlatList doesn't pass isSelected to renderItem #462

@lyahdav

Description

@lyahdav

Environment

  1. react-native -v: "github:microsoft/react-native#v0.61.38"
  2. node -v: v12.14.1
  3. npm -v: 6.13.4
  4. yarn --version: 1.17.0-20190429.1820
  5. xcodebuild -version:
    Xcode 11.4.1
    Build version 11E503a

Issue

FlatList doesn't pass isSelected to renderItem.

Steps to Reproduce

  1. Use FlatList component with a renderItem such as renderItem={({item, isSelected}) => <Text>{isSelected}</Text>.
  2. Set props acceptsKeyboardFocus={true} enableSelectionOnKeyPress={true}.
  3. Run app, focus on FlatList and use keyboard up/down arrows to move selection.

Expected Behavior

isSelected is true for the selected item

Actual Behavior

isSelected is undefined.

Reproducible Demo

Don't have time right now, maybe later.

Additional context

This works correctly in SectionList.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions