Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
lyahdav opened this issue Aug 12, 2020 · 5 comments
Labels

Comments

@lyahdav
Copy link
Collaborator

lyahdav commented Aug 12, 2020

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.

@chrisglein
Copy link
Member

@lyahdav I assume this is behavior you want for all keyboard platforms, not just macOS, is that correct?
From the issue template we have some guidance on that:

  • For feature requests to React Native, go here.
  • For feature requests to React Native for Windows (or) Desktop features in general, go here.

Just want to confirm this is something we also want in Windows. If so I can transfer this issue to that repo or create a tracking issue as we'll need to do work in both.

@lyahdav
Copy link
Collaborator Author

lyahdav commented Oct 13, 2020

Sorry for delay here. We ended up not using the VirtualizedList row selection features for now so this isn't a priority. I think it makes sense for this to be implemented for all platforms eventually.

@ghost ghost added Needs: Attention 👋 An issue that had been tagged "Needs: Author Feedback" has received activity (label applied by bot) and removed Needs: Author Feedback labels Oct 13, 2020
@chrisglein chrisglein added enhancement New feature or request and removed Needs: Attention 👋 An issue that had been tagged "Needs: Author Feedback" has received activity (label applied by bot) labels Oct 28, 2020
@github-actions
Copy link

This issue is stale because it has been open 365 days with no activity. Remove stale label or comment or this will be closed in 7 days.

@github-actions github-actions bot added the Stale label May 31, 2022
@github-actions
Copy link

github-actions bot commented Jun 8, 2022

This issue was closed because it has been stalled for 7 days with no activity.

@github-actions github-actions bot closed this as completed Jun 8, 2022
@Saadnajmi
Copy link
Collaborator

Heh. I ended up implementing this recently with a 'selectRowAtIndex' method on the listRef.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants