diff --git a/Libraries/Text/TextInput/RCTBaseTextInputView.m b/Libraries/Text/TextInput/RCTBaseTextInputView.m index 0c8eaa3bd46456..3b2ebbc8b8fd15 100644 --- a/Libraries/Text/TextInput/RCTBaseTextInputView.m +++ b/Libraries/Text/TextInput/RCTBaseTextInputView.m @@ -465,6 +465,27 @@ - (void)submitOnKeyDownIfNeeded:(NSEvent *)event } } +- (void)automaticSpellingCorrectionDidChange:(BOOL)enabled +{ + if (_onAutoCorrectToggle) { + _onAutoCorrectToggle(@{@"enabled": [NSNumber numberWithBool:enabled]}); + } +} + +- (void)continuousSpellCheckingDidChange:(BOOL)enabled +{ + if (_onSpellCheckToggle) { + _onSpellCheckToggle(@{@"enabled": [NSNumber numberWithBool:enabled]}); + } +} + +- (void)grammarCheckingDidChange:(BOOL)enabled +{ + if (_onGrammarCheckToggle) { + _onGrammarCheckToggle(@{@"enabled": [NSNumber numberWithBool:enabled]}); + } +} + - (BOOL)textInputShouldReturn { // We send `submit` event here, in `textInputShouldReturn` diff --git a/Libraries/Text/TextInput/RCTBaseTextInputViewManager.m b/Libraries/Text/TextInput/RCTBaseTextInputViewManager.m index aaba96d569a0cb..90dabf693460ca 100644 --- a/Libraries/Text/TextInput/RCTBaseTextInputViewManager.m +++ b/Libraries/Text/TextInput/RCTBaseTextInputViewManager.m @@ -78,6 +78,12 @@ @implementation RCTBaseTextInputViewManager RCT_EXPORT_VIEW_PROPERTY(onSubmitEditing, RCTBubblingEventBlock); RCT_EXPORT_VIEW_PROPERTY(submitKeyEvents, NSArray); +#if TARGET_OS_OSX // TODO(macOS ISS#2323203) +RCT_EXPORT_VIEW_PROPERTY(onAutoCorrectToggle, RCTBubblingEventBlock); +RCT_EXPORT_VIEW_PROPERTY(onSpellCheckToggle, RCTBubblingEventBlock); +RCT_EXPORT_VIEW_PROPERTY(onGrammarCheckToggle, RCTBubblingEventBlock); +#endif // TODO(macOS ISS#2323203) + RCT_EXPORT_VIEW_PROPERTY(onChange, RCTBubblingEventBlock) RCT_EXPORT_VIEW_PROPERTY(onKeyPressSync, RCTDirectEventBlock) RCT_EXPORT_VIEW_PROPERTY(onChangeSync, RCTDirectEventBlock)