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

Pass callbacks for when grammarCheck, spellCheck and autoCorrect are changed on macOS #1325

Conversation

christophpurrer
Copy link

@christophpurrer christophpurrer commented Aug 4, 2022

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

When users change spellCheck, grammarCheck or autoCorrect in the context menu, one of 3 callbacks for MULTILINE inputs are called:

  • toggleGrammarChecking
  • toggleContinuousSpellChecking
  • toggleAutomaticSpellingCorrection

If JS is going to be the source of truth for text proofing settings, we should have a way to notify JS when these settings are changed from the native side.

Changelog

[macOS] [Added] - Pass callbacks for when grammarCheck, spellCheck and autoCorrect are changed on macOS

Test Plan

Added Example

Screen.Recording.2022-08-04.at.3.11.10.PM.mov

@christophpurrer christophpurrer requested a review from a team as a code owner August 4, 2022 22:18
@christophpurrer christophpurrer force-pushed the grammarSpellcheckAutocorrectCallbacks2 branch 2 times, most recently from 7f1c87d to 83a9fa6 Compare August 4, 2022 22:23
@christophpurrer christophpurrer changed the title Pass callbacks for when grammarCheck, spellCheck and autoCorrect are changed on macOS [RFC] Pass callbacks for when grammarCheck, spellCheck and autoCorrect are changed on macOS Aug 4, 2022
@christophpurrer christophpurrer force-pushed the grammarSpellcheckAutocorrectCallbacks2 branch from 83a9fa6 to a1911e5 Compare August 4, 2022 22:26
@christophpurrer christophpurrer force-pushed the grammarSpellcheckAutocorrectCallbacks2 branch 3 times, most recently from 4e7d805 to 7c7745c Compare August 4, 2022 23:30
@christophpurrer christophpurrer force-pushed the grammarSpellcheckAutocorrectCallbacks2 branch from 7c7745c to 2a02503 Compare August 5, 2022 14:55
@christophpurrer christophpurrer force-pushed the grammarSpellcheckAutocorrectCallbacks2 branch 5 times, most recently from 2dc1342 to e5b1f71 Compare August 9, 2022 01:32
@Saadnajmi
Copy link
Collaborator

This change seems to not compile on iOS, perhaps you're missing some '#IF_TARGET_OSX' somewhere?

@christophpurrer christophpurrer force-pushed the grammarSpellcheckAutocorrectCallbacks2 branch from e5b1f71 to 9514849 Compare August 9, 2022 05:26
@Saadnajmi
Copy link
Collaborator

This should be good to go pending my one comment of Direct -> Bubbling!

…changed on Mac [RFC]

When users change spellCheck, grammarCheck or autoCorrect in the context menu, one of 3 callbacks for MULTILINE inputs are called:
- toggleGrammarChecking
- toggleContinuousSpellChecking
- toggleAutomaticSpellingCorrection

If JS is going to be the source of truth for text proofing settings, we should have a way to notify JS when these settings are changed from the native side.
@christophpurrer christophpurrer force-pushed the grammarSpellcheckAutocorrectCallbacks2 branch from 9514849 to b3d081f Compare August 9, 2022 23:26
@Saadnajmi Saadnajmi merged commit 24acd40 into microsoft:main Aug 10, 2022
@christophpurrer christophpurrer deleted the grammarSpellcheckAutocorrectCallbacks2 branch August 10, 2022 00:49
shwanton pushed a commit to shwanton/react-native-macos that referenced this pull request Feb 13, 2023
…changed on Mac [RFC] (microsoft#1325)

When users change spellCheck, grammarCheck or autoCorrect in the context menu, one of 3 callbacks for MULTILINE inputs are called:
- toggleGrammarChecking
- toggleContinuousSpellChecking
- toggleAutomaticSpellingCorrection

If JS is going to be the source of truth for text proofing settings, we should have a way to notify JS when these settings are changed from the native side.

Co-authored-by: Alex Chiu <ackchiu@fb.com>
# Conflicts:
#	Libraries/Text/TextInput/RCTBaseTextInputView.m
#	Libraries/Text/TextInput/RCTBaseTextInputViewManager.m

# Conflicts:
#	Libraries/Components/TextInput/TextInput.js
#	packages/rn-tester/js/examples/TextInput/TextInputExample.ios.js

# Conflicts:
#	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
…changed on Mac [RFC] (microsoft#1325)

When users change spellCheck, grammarCheck or autoCorrect in the context menu, one of 3 callbacks for MULTILINE inputs are called:
- toggleGrammarChecking
- toggleContinuousSpellChecking
- toggleAutomaticSpellingCorrection

If JS is going to be the source of truth for text proofing settings, we should have a way to notify JS when these settings are changed from the native side.

Co-authored-by: Alex Chiu <ackchiu@fb.com>
# Conflicts:
#	Libraries/Text/TextInput/RCTBaseTextInputView.m
#	Libraries/Text/TextInput/RCTBaseTextInputViewManager.m

# Conflicts:
#	Libraries/Components/TextInput/TextInput.js
#	packages/rn-tester/js/examples/TextInput/TextInputExample.ios.js

# Conflicts:
#	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.

None yet

2 participants