Skip to content

feat: add autoCorrect and spellCheck props - #519

Merged
hejsztynx merged 9 commits into
software-mansion:mainfrom
fendent:feat/autocorrect-spellcheck-props
Sep 21, 2026
Merged

hejsztynx merged 9 commits into
software-mansion:mainfrom
fendent:feat/autocorrect-spellcheck-props

Conversation

@fendent

@fendent fendent commented Apr 6, 2026

Copy link
Copy Markdown
Contributor

Summary

Adds autoCorrect and spellCheck boolean props to control iOS UITextAutocorrectionType and UITextSpellCheckingType.

Currently there's no way to disable autocorrect or spell checking on the input. These props follow the same pattern as the existing autoCapitalize prop.

<EnrichedTextInput
  autoCorrect={false}
  spellCheck={false}
/>

When not specified, both default to the system behavior (enabled).

Test Plan

  1. Set autoCorrect={false} — verify iOS does not suggest autocorrect replacements
  2. Set spellCheck={false} — verify iOS does not underline misspelled words
  3. Omit both props — verify default system behavior (both enabled)
  4. Toggle props at runtime — verify behavior updates

Compatibility

OS Implemented
iOS
Android

Checklist

  • E2E tests are passing
  • Required E2E tests have been added (if applicable)

Adds boolean autoCorrect and spellCheck props to control iOS
autocorrection and spell checking. Both default to system behavior
when not specified.

@exploIF exploIF left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

For the autoCorrect, it would be the best to introduce this prop on Android too, so it's consistent with react native TextInput

Comment thread src/native/EnrichedTextInput.tsx Outdated
@nickmccomb

Copy link
Copy Markdown

Any updates on this?

Copilot AI lite review requested due to automatic review settings September 17, 2026 14:57

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🟡 Changes recommended

Unresolved platform behavior, runtime-toggle, documentation, and test-coverage findings remain.

Get a fresh assessment by requesting another Copilot review.

Pull request overview

Adds autoCorrect and spellCheck props to the enriched text input API and native implementations.

Changes:

  • Adds public and native prop definitions.
  • Forwards values and configures iOS input traits.
  • Adds Android autocorrection handling.
File summaries
File Review summary
src/types.ts Moderate: web silently ignores autoCorrect. Nits: update API documentation and fix malformed JSDoc.
src/spec/EnrichedTextInputNativeComponent.ts Adds native codegen props; no findings.
src/native/EnrichedTextInput.tsx Forwards the new props. Nit: add Maestro coverage for false, default, and runtime-toggle cases.
ios/EnrichedTextInputView.mm Moderate: refresh the active input when toggling autoCorrect or spellCheck.
android/src/main/java/com/swmansion/enriched/textinput/EnrichedTextInputViewManager.kt Moderate: spellCheck is ignored on Android.
android/src/main/java/com/swmansion/enriched/textinput/EnrichedTextInputView.kt Updates Android autocorrection flags; no findings.
Review details

Suppressed comments (4)

android/src/main/java/com/swmansion/enriched/textinput/EnrichedTextInputViewManager.kt:265

  • This handler silently ignores spellCheck, so spellCheck={false} has no effect on Android even though the compatibility table marks Android as implemented. Please either implement the Android behavior if both platforms are intended, or mark this prop as iOS-only and update the compatibility/documentation to match.
  @ReactProp(name = "spellCheck")
  override fun setSpellCheck(
    view: EnrichedTextInputView?,
    spellCheck: Boolean,
  ) {
    // not supported in Android's RN TextInput

ios/EnrichedTextInputView.mm:844

  • Changing spellCheck while the editor is focused only assigns the UITextView trait. UIKit may not reconfigure spell checking for the current first responder until the input view is reloaded/refocused, so toggling this prop at runtime can leave the existing underline behavior unchanged. Apply the same active-input refresh used for the other input traits.
  if (newViewProps.spellCheck != oldViewProps.spellCheck) {
    textView.spellCheckingType = newViewProps.spellCheck
                                     ? UITextSpellCheckingTypeYes
                                     : UITextSpellCheckingTypeNo;
  }

src/native/EnrichedTextInput.tsx:346

  • The new native prop paths have no Maestro coverage for the documented false, omitted/default, or runtime-toggle cases, even though this repository runs a native E2E suite on both iOS and Android (.maestro/scripts/run-tests-all.sh). Please add focused flows for these cases so regressions in the platform-specific behavior are caught.
      autoCorrect={autoCorrect}
      spellCheck={spellCheck ?? autoCorrect}

src/types.ts:669

  • EnrichedTextInputProps is shared by the web build, but src/web/EnrichedTextInput.tsx does not read autoCorrect, and this prop has no @platform annotation. A web consumer can therefore pass the newly typed boolean and get no behavior; either wire it to the editor DOM or mark it as native-only (Android/iOS) to avoid advertising a silently ignored API.
  /** If false, disables auto-correct. Defaults `true`. */
  autoCorrect?: boolean;
  • Files reviewed: 6/6 changed files
  • Comments generated: 3
  • Review effort level: Lite

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread ios/EnrichedTextInputView.mm
Comment thread src/types.ts Outdated
Comment thread src/types.ts
@hejsztynx
hejsztynx requested a review from exploIF September 17, 2026 15:21

@exploIF exploIF left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Looks good to me

@szydlovsky szydlovsky left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

overall looks good, one small comment

Comment thread docs/docs/api-reference/enriched-text-input.md
@hejsztynx
hejsztynx merged commit f2554cc into software-mansion:main Sep 21, 2026
9 checks passed
@hejsztynx

Copy link
Copy Markdown
Collaborator

Thank you @fendent for your work and coming up with this idea!

@fendent

fendent commented Sep 21, 2026

Copy link
Copy Markdown
Contributor Author

Of course! Glad to help. Sorry I couldn't follow up on this further past the initial PR. Life 🙃

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants