From 9b2af4e9f3348ea0bca515e02d59331db077dbf2 Mon Sep 17 00:00:00 2001 From: Mustafa Date: Thu, 3 Dec 2026 17:07:01 +0300 Subject: [PATCH] fix(iOS): synchronize keyboard settings on initial mount --- ios/EnrichedTextInputView.mm | 26 ++++++++++++++------------ 1 file changed, 14 insertions(+), 12 deletions(-) diff --git a/ios/EnrichedTextInputView.mm b/ios/EnrichedTextInputView.mm index b38d56f54..3e138bff8 100644 --- a/ios/EnrichedTextInputView.mm +++ b/ios/EnrichedTextInputView.mm @@ -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