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

Flatlist: Let ArrowUp/ArrowDown bubble at the top/bottom of list #1458

Merged
merged 2 commits into from
Oct 27, 2022

Conversation

Saadnajmi
Copy link
Collaborator

Please select one of the following

  • I am removing an existing difference between facebook/react-native and microsoft/react-native-macos 👍
  • I am cherry-picking a change from Facebook's react-native into microsoft/react-native-macos 👍
  • I am making a fix / change for the macOS implementation of react-native
  • I am making a change required for Microsoft usage of react-native

Summary

We have a client who would like the ArrowUp/Down event to bubble at the top and bottom of Flatlist (so that a super view like FocusZone can handle it). This is a simple change to make that happen.

Changelog

[macOS] [Fixed] - Flatlist: Let ArrowUp/ArrowDown bubble at the top/bottom of list

Test Plan

(I didn't include the test code in this PR)

Added a simple validKeysDown/onKeyDown test to the View that wraps <Flatlist> in the Flatlist test page to verify that the event did bubble.

Screen.Recording.2022-10-26.at.1.32.54.PM.mov

@Saadnajmi Saadnajmi requested a review from a team as a code owner October 26, 2022 20:38
@harrieshin
Copy link

just to be clear at the end of the flat list, user will TAB to get out which is similar to other native macos list?

@Saadnajmi
Copy link
Collaborator Author

just to be clear at the end of the flat list, user will TAB to get out which is similar to other native macos list?

Right now, Flatlist still differs from native macOS lists in that "tab" will move focus between the rows, while arrow keys move selection. This is bad UX IMO, but when I worked on it last, I didn't know how to solve it without wrapping the Flatlist in a FocusZone (what our client does).

So with this change, at the end of a Flatlist, Tab will move focus to the next thing in the key view loop. If the Flatlist is wrapped by a FocusZone, that will be the first thing outside the FocusZone.

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

Successfully merging this pull request may close these issues.

2 participants