Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 14 additions & 12 deletions ios/EnrichedTextInputView.mm
Original file line number Diff line number Diff line change
Expand Up @@ -835,18 +835,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;
// Codegen's false defaults can match the initial props while UITextView
// still uses its system defaults. Synchronize the native state before focus.
UITextAutocorrectionType autocorrectionType =
newViewProps.autoCorrect ? UITextAutocorrectionTypeYes
: UITextAutocorrectionTypeNo;
if (textView.autocorrectionType != autocorrectionType) {
textView.autocorrectionType = autocorrectionType;
}

UITextSpellCheckingType spellCheckingType =
newViewProps.spellCheck ? UITextSpellCheckingTypeYes
: UITextSpellCheckingTypeNo;
if (textView.spellCheckingType != spellCheckingType) {
textView.spellCheckingType = spellCheckingType;
}

// isOnChangeHtmlSet
Expand Down