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

Adds declarative props to clear/submit MultilineTextInput #1423

Merged
merged 1 commit into from
Sep 21, 2022

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 brings macOS parity with react-native-windows microsoft/react-native-windows#7333 for MultilineTextInput fields See react-native-windows PR for desired feature set.

We can't do it for SinglelineTextInput fields (at least not w/o hacks) as it does not support overriding the keyDown event :-( https://stackoverflow.com/a/6076492

Changelog

[macOS] [Added] - Adds declarative props to clear/submit MultilineTextInput

Test Plan

Screen.Recording.2022-09-08.at.12.46.13.PM.mov

@christophpurrer christophpurrer force-pushed the keydownSubmit branch 4 times, most recently from 4728795 to 3f9ac1c Compare September 12, 2022 18:23
This brings macOS parity with react-native-windows microsoft/react-native-windows#7333 for MultilineTextInput fields
See react-native-windows PR for desired feature set.

We can't do it for SinglelineTextInput fields (at least not w/o hacks) as it does not support overriding the keyDown event :-(
https://stackoverflow.com/a/6076492
@christophpurrer
Copy link
Author

Awesome feedback.
I could simplify the logic.
I also verified that I am not breaking existing multilineTextInput behavior.

Screen.Recording.2022-09-20.at.10.38.35.PM.mov

Copy link
Collaborator

@Saadnajmi Saadnajmi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: in hindsight would have asked for an example other than Enter+ a modifier (like, "a"), but that seemed kinda pointless and code seems sound :)

@Saadnajmi Saadnajmi merged commit 377063c into microsoft:main Sep 21, 2022
@shwanton shwanton mentioned this pull request Jan 25, 2023
4 tasks
shwanton pushed a commit to shwanton/react-native-macos that referenced this pull request Feb 13, 2023
…1423)

This brings macOS parity with react-native-windows microsoft/react-native-windows#7333 for MultilineTextInput fields
See react-native-windows PR for desired feature set.

We can't do it for SinglelineTextInput fields (at least not w/o hacks) as it does not support overriding the keyDown event :-(
https://stackoverflow.com/a/6076492

Co-authored-by: Alex Chiu <ackchiu@fb.com>
# Conflicts:
#	Libraries/Components/TextInput/TextInput.js
#	Libraries/Text/TextInput/RCTBackedTextInputDelegate.h
#	Libraries/Text/TextInput/RCTBaseTextInputView.h
#	Libraries/Text/TextInput/RCTBaseTextInputView.m
#	Libraries/Text/TextInput/RCTBaseTextInputViewManager.m
shwanton pushed a commit to shwanton/react-native-macos that referenced this pull request Mar 10, 2023
…1423)

This brings macOS parity with react-native-windows microsoft/react-native-windows#7333 for MultilineTextInput fields
See react-native-windows PR for desired feature set.

We can't do it for SinglelineTextInput fields (at least not w/o hacks) as it does not support overriding the keyDown event :-(
https://stackoverflow.com/a/6076492

Co-authored-by: Alex Chiu <ackchiu@fb.com>
# Conflicts:
#	Libraries/Components/TextInput/TextInput.js
#	Libraries/Text/TextInput/RCTBackedTextInputDelegate.h
#	Libraries/Text/TextInput/RCTBaseTextInputView.h
#	Libraries/Text/TextInput/RCTBaseTextInputView.m
#	Libraries/Text/TextInput/RCTBaseTextInputViewManager.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.

2 participants