From 317910b5d86327d15052f1c30926332ebf30bcf2 Mon Sep 17 00:00:00 2001 From: Sean Murphy Date: Sun, 5 Apr 2026 23:52:21 -0400 Subject: [PATCH 1/6] 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 66c22512b..38927e350 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 a58756bc9..3dd6cae92 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 83e557d5f..df2766a09 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 ada3ceb69..fa8a7d9aa 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; From e3d54c6873389cc5300c72f6124e6b3bd7db1660 Mon Sep 17 00:00:00 2001 From: Krystian Sienkiewicz Date: Thu, 17 Sep 2026 15:02:55 +0200 Subject: [PATCH 2/6] fix: default spellCheck to autoCorrect value --- src/native/EnrichedTextInput.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/native/EnrichedTextInput.tsx b/src/native/EnrichedTextInput.tsx index bdfd81ff3..cfe12104c 100644 --- a/src/native/EnrichedTextInput.tsx +++ b/src/native/EnrichedTextInput.tsx @@ -58,7 +58,7 @@ export const EnrichedTextInput = ({ selectionColor, style, autoCapitalize = ENRICHED_TEXT_INPUT_DEFAULT_PROPS.autoCapitalize, - autoCorrect, + autoCorrect = true, spellCheck, htmlStyle = ENRICHED_TEXT_INPUT_DEFAULT_PROPS.htmlStyle, linkRegex: _linkRegex, @@ -343,7 +343,7 @@ export const EnrichedTextInput = ({ style={style} autoCapitalize={autoCapitalize} autoCorrect={autoCorrect} - spellCheck={spellCheck} + spellCheck={spellCheck ?? autoCorrect} htmlStyle={normalizedHtmlStyle} linkRegex={linkRegex} onInputFocus={onFocus} From 2280f55ce6b49a539f1d0d046efe2d65ba296808 Mon Sep 17 00:00:00 2001 From: Krystian Sienkiewicz Date: Thu, 17 Sep 2026 16:56:00 +0200 Subject: [PATCH 3/6] feat(android): autoCorrect prop --- .../enriched/textinput/EnrichedTextInputView.kt | 12 ++++++++++++ .../textinput/EnrichedTextInputViewManager.kt | 16 ++++++++++++++++ src/types.ts | 5 ++++- 3 files changed, 32 insertions(+), 1 deletion(-) diff --git a/android/src/main/java/com/swmansion/enriched/textinput/EnrichedTextInputView.kt b/android/src/main/java/com/swmansion/enriched/textinput/EnrichedTextInputView.kt index f4aed71ea..65ad058e6 100644 --- a/android/src/main/java/com/swmansion/enriched/textinput/EnrichedTextInputView.kt +++ b/android/src/main/java/com/swmansion/enriched/textinput/EnrichedTextInputView.kt @@ -614,6 +614,18 @@ class EnrichedTextInputView : } } + fun setAutoCorrect(autoCorrect: Boolean) { + val flagsToUnset = InputType.TYPE_TEXT_FLAG_AUTO_CORRECT or InputType.TYPE_TEXT_FLAG_NO_SUGGESTIONS + + val flagsToSet = + when (autoCorrect) { + true -> InputType.TYPE_TEXT_FLAG_AUTO_CORRECT + false -> InputType.TYPE_TEXT_FLAG_NO_SUGGESTIONS + } + + this.inputType = (this.inputType and flagsToUnset.inv()) or flagsToSet + } + fun setAutoCapitalize(flagName: String?) { val flag = when (flagName) { diff --git a/android/src/main/java/com/swmansion/enriched/textinput/EnrichedTextInputViewManager.kt b/android/src/main/java/com/swmansion/enriched/textinput/EnrichedTextInputViewManager.kt index 9dcbb8244..8b43f3280 100644 --- a/android/src/main/java/com/swmansion/enriched/textinput/EnrichedTextInputViewManager.kt +++ b/android/src/main/java/com/swmansion/enriched/textinput/EnrichedTextInputViewManager.kt @@ -249,6 +249,22 @@ class EnrichedTextInputViewManager : view.allowFontScaling = allowFontScaling } + @ReactProp(name = "autoCorrect") + override fun setAutoCorrect( + view: EnrichedTextInputView?, + autoCorrect: Boolean, + ) { + view?.setAutoCorrect(autoCorrect) + } + + @ReactProp(name = "spellCheck") + override fun setSpellCheck( + view: EnrichedTextInputView?, + spellCheck: Boolean, + ) { + // not supported in Android's RN TextInput + } + override fun onAfterUpdateTransaction(view: EnrichedTextInputView) { super.onAfterUpdateTransaction(view) view.afterUpdateTransaction() diff --git a/src/types.ts b/src/types.ts index f23c900b5..5adc53b20 100644 --- a/src/types.ts +++ b/src/types.ts @@ -668,7 +668,10 @@ export interface EnrichedTextInputProps extends Omit { /** If false, disables auto-correct. Defaults `true`. */ autoCorrect?: boolean; - /** If false, disables spell-check style (i.e. red underlines). The default value is inherited from the`autoCorrect` prop. */ + /** If false, disables spell-check style (i.e. red underlines). The default value is inherited from the`autoCorrect` prop. + * + * @platform ios + */ spellCheck?: boolean; /** Style overrides applied to the rendered HTML content inside the editor. */ From cc7f2a18ca2ed3eda73c856b4dab8fa626738eba Mon Sep 17 00:00:00 2001 From: Krystian Sienkiewicz Date: Thu, 17 Sep 2026 17:21:00 +0200 Subject: [PATCH 4/6] refactor: typo --- src/types.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/types.ts b/src/types.ts index 5adc53b20..92d2108b4 100644 --- a/src/types.ts +++ b/src/types.ts @@ -668,7 +668,7 @@ export interface EnrichedTextInputProps extends Omit { /** If false, disables auto-correct. Defaults `true`. */ autoCorrect?: boolean; - /** If false, disables spell-check style (i.e. red underlines). The default value is inherited from the`autoCorrect` prop. + /** If false, disables spell-check style (i.e. red underlines). The default value is inherited from the `autoCorrect` prop. * * @platform ios */ From eca2d11e891098117b945825c4a2f428ee1c4846 Mon Sep 17 00:00:00 2001 From: Krystian Sienkiewicz Date: Thu, 17 Sep 2026 17:21:11 +0200 Subject: [PATCH 5/6] docs: update --- docs/docs/api-reference/enriched-text-input.md | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/docs/docs/api-reference/enriched-text-input.md b/docs/docs/api-reference/enriched-text-input.md index a600904f5..87a61e7fa 100644 --- a/docs/docs/api-reference/enriched-text-input.md +++ b/docs/docs/api-reference/enriched-text-input.md @@ -89,6 +89,14 @@ If `true`, the input respects the system's accessibility font scaling settings. | --------- | ------- | ------------ | | `boolean` | `true` | Android, iOS | +### `autoCorrect` {#autocorrect} + +If false, disables auto-correct. + +| Type | Default | Platforms | +| --------- | ------- | ------------ | +| `boolean` | `true` | Android, iOS | + ### `autoFocus` {#autofocus} If `true`, focuses the input when it mounts. @@ -633,6 +641,14 @@ cursor (caret) also uses this color. | ---------------------------------------------- | -------------- | ----------------- | | [`color`](https://reactnative.dev/docs/colors) | system default | Android, iOS, Web | +### `spellCheck` {#spellcheck} + +If false, disables spell-check style (i.e. red underlines). The default value is inherited from the `autoCorrect` prop. + +| Type | Default | Platforms | +| --------- | ------------- | --------- | +| `boolean` | `autoCorrect` | iOS | + ### `style` {#style} Controls the layout, dimensions, typography, borders, shadows, opacity, and From 1e6098562689845c073b1c0a52e009bcb72954f0 Mon Sep 17 00:00:00 2001 From: Krystian Sienkiewicz Date: Mon, 21 Sep 2026 12:59:01 +0200 Subject: [PATCH 6/6] docs: link the autoCorrect reference in spellCheck docs section --- docs/docs/api-reference/enriched-text-input.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/docs/docs/api-reference/enriched-text-input.md b/docs/docs/api-reference/enriched-text-input.md index c1fd8b4df..357d1b15e 100644 --- a/docs/docs/api-reference/enriched-text-input.md +++ b/docs/docs/api-reference/enriched-text-input.md @@ -643,11 +643,11 @@ cursor (caret) also uses this color. ### `spellCheck` {#spellcheck} -If false, disables spell-check style (i.e. red underlines). The default value is inherited from the `autoCorrect` prop. +If false, disables spell-check style (i.e. red underlines). The default value is inherited from the [`autoCorrect`](#autocorrect) prop. -| Type | Default | Platforms | -| --------- | ------------- | --------- | -| `boolean` | `autoCorrect` | iOS | +| Type | Default | Platforms | +| --------- | ----------------------------- | --------- | +| `boolean` | [`autoCorrect`](#autocorrect) | iOS | ### `style` {#style}