From 317910b5d86327d15052f1c30926332ebf30bcf2 Mon Sep 17 00:00:00 2001 From: Sean Murphy Date: Sun, 5 Apr 2026 23:52:21 -0400 Subject: [PATCH] feat: add autoCorrect and spellCheck props Adds boolean autoCorrect and spellCheck props to control iOS autocorrection and spell checking. Both default to system behavior when not specified. --- ios/EnrichedTextInputView.mm | 14 ++++++++++++++ src/native/EnrichedTextInput.tsx | 4 ++++ src/spec/EnrichedTextInputNativeComponent.ts | 2 ++ src/types.ts | 2 ++ 4 files changed, 22 insertions(+) diff --git a/ios/EnrichedTextInputView.mm b/ios/EnrichedTextInputView.mm index 66c22512..38927e35 100644 --- a/ios/EnrichedTextInputView.mm +++ b/ios/EnrichedTextInputView.mm @@ -897,6 +897,20 @@ - (void)updateProps:(Props::Shared const &)props } } + // autoCorrect + if (newViewProps.autoCorrect != oldViewProps.autoCorrect) { + textView.autocorrectionType = newViewProps.autoCorrect + ? UITextAutocorrectionTypeYes + : UITextAutocorrectionTypeNo; + } + + // spellCheck + if (newViewProps.spellCheck != oldViewProps.spellCheck) { + textView.spellCheckingType = newViewProps.spellCheck + ? UITextSpellCheckingTypeYes + : UITextSpellCheckingTypeNo; + } + // isOnChangeHtmlSet _emitHtml = newViewProps.isOnChangeHtmlSet; diff --git a/src/native/EnrichedTextInput.tsx b/src/native/EnrichedTextInput.tsx index a58756bc..3dd6cae9 100644 --- a/src/native/EnrichedTextInput.tsx +++ b/src/native/EnrichedTextInput.tsx @@ -58,6 +58,8 @@ export const EnrichedTextInput = ({ selectionColor, style, autoCapitalize = ENRICHED_TEXT_INPUT_DEFAULT_PROPS.autoCapitalize, + autoCorrect, + spellCheck, htmlStyle = ENRICHED_TEXT_INPUT_DEFAULT_PROPS.htmlStyle, linkRegex: _linkRegex, onFocus, @@ -333,6 +335,8 @@ export const EnrichedTextInput = ({ selectionColor={selectionColor} style={style} autoCapitalize={autoCapitalize} + autoCorrect={autoCorrect} + spellCheck={spellCheck} htmlStyle={normalizedHtmlStyle} linkRegex={linkRegex} onInputFocus={onFocus} diff --git a/src/spec/EnrichedTextInputNativeComponent.ts b/src/spec/EnrichedTextInputNativeComponent.ts index 83e557d5..df2766a0 100644 --- a/src/spec/EnrichedTextInputNativeComponent.ts +++ b/src/spec/EnrichedTextInputNativeComponent.ts @@ -361,6 +361,8 @@ export interface NativeProps extends ViewProps { cursorColor?: ColorValue; selectionColor?: ColorValue; autoCapitalize?: string; + autoCorrect?: boolean; + spellCheck?: boolean; htmlStyle?: HtmlStyleInternal; scrollEnabled?: boolean; linkRegex?: LinkNativeRegex; diff --git a/src/types.ts b/src/types.ts index ada3ceb6..fa8a7d9a 100644 --- a/src/types.ts +++ b/src/types.ts @@ -449,6 +449,8 @@ export interface EnrichedTextInputProps extends Omit { cursorColor?: ColorValue; selectionColor?: ColorValue; autoCapitalize?: 'none' | 'sentences' | 'words' | 'characters'; + autoCorrect?: boolean; + spellCheck?: boolean; htmlStyle?: HtmlStyle; style?: ViewStyle | TextStyle; scrollEnabled?: boolean;