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 clients to override keyboard focus props on FlatList #1403

Merged
merged 3 commits into from
Aug 31, 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

With enableSelectionOnKeyPress set to true, I made the Flatlist by default focusable and show the focus ring. This matches the behavior of some NSTableViews in macOS, but not all. There are cases where the overall table is focusable and does not show a focus ring (showing the selected cells with a highlight instead) like in sidebars.

Let's allow the user to override focusable and enableFocusRing on Flatlist, so that they have more control over the UX. Turns out all this needed was moving {...props} after keyboardNavigationProps, so that the users passed in props could overwrite the defaults.

Changelog

[macOS] [Fixed] - Allow clients to override keyboard focus props on FlatList

Test Plan

Added two switches to the test page to test the combos of props.

Screen.Recording.2022-08-30.at.6.29.16.PM.mov

@Saadnajmi Saadnajmi requested a review from a team as a code owner August 31, 2022 01:35
@Saadnajmi Saadnajmi merged commit 29a1c7d into microsoft:main Aug 31, 2022
@Saadnajmi Saadnajmi deleted the client-overrides branch August 31, 2022 21:33
Saadnajmi added a commit to Saadnajmi/react-native-macos that referenced this pull request Aug 31, 2022
…#1403)

* Allow client to override keyboard focus props on Flatlist

* typo

* Update flow type
Saadnajmi added a commit to Saadnajmi/react-native-macos that referenced this pull request Aug 31, 2022
…#1403)

* Allow client to override keyboard focus props on Flatlist

* typo

* Update flow type
chiuam pushed a commit to chiuam/react-native-macos that referenced this pull request Aug 31, 2022
…#1403)

* Allow client to override keyboard focus props on Flatlist

* typo

* Update flow type
Saadnajmi added a commit that referenced this pull request Aug 31, 2022
…1407)

* Allow client to override keyboard focus props on Flatlist

* typo

* Update flow type
Saadnajmi added a commit that referenced this pull request Aug 31, 2022
…1406)

* Allow client to override keyboard focus props on Flatlist

* typo

* Update flow type
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.

3 participants