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

Refactor handling of keyDown/keyUp #1338

Merged

Conversation

christophpurrer
Copy link

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

This refactors / simplifies certain keyUp|Down event handling.
It will make a later change (adding textInput handling for textInput fields) easier (to review)

Changelog

[macOS] [Changed] - Refactor handling of keyDown/keyUp

Test Plan

Note: The button example is not working ...
Before

Screen.Recording.2022-08-08.at.1.02.19.PM.mov

After

Screen.Recording.2022-08-08.at.1.49.21.PM.mov

@christophpurrer christophpurrer requested a review from a team as a code owner August 8, 2022 20:50
@Saadnajmi Saadnajmi self-assigned this Aug 8, 2022
@Saadnajmi
Copy link
Collaborator

Good to merge once build breaks are fixed!

This refactors / simplifies certain keyUp|Down event handling.
It will make a later change (adding textInput handling for textInput fields) easier (to review)
@christophpurrer
Copy link
Author

I was missing yet another
if TARGET_OS_OSX // TODO(macOS GH#774)
I should also build for iOS before publishing a PR ...

@Saadnajmi
Copy link
Collaborator

I was missing yet another
if TARGET_OS_OSX // TODO(macOS GH#774)
I should also build for iOS before publishing a PR ...

Theoretically all this code could be ported to iOS easily one day 🤔

@Saadnajmi Saadnajmi merged commit 4b9ab10 into microsoft:main Aug 10, 2022
@christophpurrer christophpurrer deleted the refactorKeyUpDownEventHandling branch August 10, 2022 00:49
Saadnajmi added a commit to Saadnajmi/react-native-macos that referenced this pull request Aug 24, 2022
This refactors / simplifies certain keyUp|Down event handling.
It will make a later change (adding textInput handling for textInput fields) easier (to review)

Co-authored-by: Scott Kyle <skyle@fb.com>
Saadnajmi pushed a commit to Saadnajmi/react-native-macos that referenced this pull request Aug 24, 2022
This refactors / simplifies certain keyUp|Down event handling.
It will make a later change (adding textInput handling for textInput fields) easier (to review)

Co-authored-by: Scott Kyle <skyle@fb.com>
Saadnajmi pushed a commit to Saadnajmi/react-native-macos that referenced this pull request Aug 25, 2022
This refactors / simplifies certain keyUp|Down event handling.
It will make a later change (adding textInput handling for textInput fields) easier (to review)

Co-authored-by: Scott Kyle <skyle@fb.com>
Saadnajmi pushed a commit to Saadnajmi/react-native-macos that referenced this pull request Aug 25, 2022
This refactors / simplifies certain keyUp|Down event handling.
It will make a later change (adding textInput handling for textInput fields) easier (to review)

Co-authored-by: Scott Kyle <skyle@fb.com>
Saadnajmi added a commit that referenced this pull request Aug 25, 2022
…1374)

* Refactor handling of keyDown/keyUp (#1338)

This refactors / simplifies certain keyUp|Down event handling.
It will make a later change (adding textInput handling for textInput fields) easier (to review)

Co-authored-by: Scott Kyle <skyle@fb.com>

* Deprecate onScrollKeyDown, refactor Flatlist selection logic (#1365)

* Deprecate onScrollKeyDown

remove pressable diff

Remove JS handling for PageUp/Down, fix flow errors

Add back "autoscroll to focused view" behavior

remove commented code

remove change to pressable

Update documentation

fix flow error

fix lint issue

Fix 'selectRowAtIndex'

More simplification

lock

* Make method public again

* Add initialSelectedIndex

* macOS tags

* fix lint

* RNTester: only show the Flatlist keyboard navigation switch on macOS

Co-authored-by: Christoph Purrer <christophpurrer@outlook.com>
Co-authored-by: Scott Kyle <skyle@fb.com>
Saadnajmi added a commit that referenced this pull request Aug 26, 2022
…1375)

* Revert "Revert Flatlist changes (#1306)"

This reverts commit 8ce9545.

* Refactor handling of keyDown/keyUp (#1338)

This refactors / simplifies certain keyUp|Down event handling.
It will make a later change (adding textInput handling for textInput fields) easier (to review)

Co-authored-by: Scott Kyle <skyle@fb.com>

* Deprecate onScrollKeyDown, refactor Flatlist selection logic (#1365)

* Deprecate onScrollKeyDown

remove pressable diff

Remove JS handling for PageUp/Down, fix flow errors

Add back "autoscroll to focused view" behavior

remove commented code

remove change to pressable

Update documentation

fix flow error

fix lint issue

Fix 'selectRowAtIndex'

More simplification

lock

* Make method public again

* Add initialSelectedIndex

* macOS tags

* fix lint

* remove one more reference

* yarn lint --fix

* RNTester: only show the Flatlist keyboard navigation switch on macOS

Co-authored-by: Christoph Purrer <christophpurrer@outlook.com>
Co-authored-by: Scott Kyle <skyle@fb.com>
shwanton pushed a commit to shwanton/react-native-macos that referenced this pull request Feb 13, 2023
This refactors / simplifies certain keyUp|Down event handling.
It will make a later change (adding textInput handling for textInput fields) easier (to review)

Co-authored-by: Scott Kyle <skyle@fb.com>
# Conflicts:
#	React/Views/RCTViewKeyboardEvent.m
shwanton pushed a commit to shwanton/react-native-macos that referenced this pull request Mar 10, 2023
This refactors / simplifies certain keyUp|Down event handling.
It will make a later change (adding textInput handling for textInput fields) easier (to review)

Co-authored-by: Scott Kyle <skyle@fb.com>
# Conflicts:
#	React/Views/RCTViewKeyboardEvent.m
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants