Skip to content

Allow setting selected row on VirtualizedList (FlatList/SectionList) by clicking a row #539

Description

@lyahdav

Proposal: Allow setting selected row on VirtualizedList (FlatList/SectionList) by clicking a row

Summary

Currently VirtualizedList has a selectedRowIndex in its state that gets set when pressing up/down arrow keys if you set the enableSelectionOnKeyPress prop to true. But typically you can select a selected row in a list component also by clicking on a row. Right now VirtualizedList doesn't expose a way to do so.

Motivation

In Summary.

Basic example

Perhaps it would be sufficient to add a selectedRowIndex prop?

Open Questions

Possibly as part of this PR this should get upstreamed to RN core.

Activity

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

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