From 26b8908cae7fd17032ec37493ae0838d1369215b Mon Sep 17 00:00:00 2001 From: Paul Newby <37700250+paulnewby@users.noreply.github.com> Date: Fri, 23 Oct 2026 15:52:19 +0100 Subject: [PATCH] Fix dictated text duplicated in controlled single-line TextInput on iOS (Fabric) --- .../ComponentViews/TextInput/RCTTextInputComponentView.mm | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/packages/react-native/React/Fabric/Mounting/ComponentViews/TextInput/RCTTextInputComponentView.mm b/packages/react-native/React/Fabric/Mounting/ComponentViews/TextInput/RCTTextInputComponentView.mm index 281c5ea88b53..a027c8c1415f 100644 --- a/packages/react-native/React/Fabric/Mounting/ComponentViews/TextInput/RCTTextInputComponentView.mm +++ b/packages/react-native/React/Fabric/Mounting/ComponentViews/TextInput/RCTTextInputComponentView.mm @@ -959,8 +959,12 @@ - (BOOL)_textOf:(NSAttributedString *)newText equals:(NSAttributedString *)oldTe } }]; - BOOL shouldFallbackToBareTextComparison = - [_backedTextInputView.textInputMode.primaryLanguage isEqualToString:@"dictation"] || + BOOL shouldFallbackDictation = [_backedTextInputView.textInputMode.primaryLanguage isEqualToString:@"dictation"]; + if (@available(iOS 16.0, *)) { + shouldFallbackDictation = shouldFallbackDictation || _backedTextInputView.dictationRecognizing; + } + + BOOL shouldFallbackToBareTextComparison = shouldFallbackDictation || [_backedTextInputView.textInputMode.primaryLanguage isEqualToString:@"ko-KR"] || _backedTextInputView.markedTextRange || _backedTextInputView.isSecureTextEntry || fontHasBeenUpdatedBySystem;