Skip to content

Commit 2de6e30

Browse files
authored
Fix dictated text duplicated in controlled single-line TextInput on iOS (Fabric) (#59407)
1 parent 0984d6d commit 2de6e30

1 file changed

Lines changed: 6 additions & 2 deletions

File tree

‎packages/react-native/React/Fabric/Mounting/ComponentViews/TextInput/RCTTextInputComponentView.mm‎

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -972,8 +972,12 @@ - (BOOL)_textOf:(NSAttributedString *)newText equals:(NSAttributedString *)oldTe
972972
}
973973
}];
974974
975-
BOOL shouldFallbackToBareTextComparison =
976-
[_backedTextInputView.textInputMode.primaryLanguage isEqualToString:@"dictation"] ||
975+
BOOL shouldFallbackDictation = [_backedTextInputView.textInputMode.primaryLanguage isEqualToString:@"dictation"];
976+
if (@available(iOS 16.0, *)) {
977+
shouldFallbackDictation = shouldFallbackDictation || _backedTextInputView.dictationRecognizing;
978+
}
979+
980+
BOOL shouldFallbackToBareTextComparison = shouldFallbackDictation ||
977981
[_backedTextInputView.textInputMode.primaryLanguage isEqualToString:@"ko-KR"] ||
978982
_backedTextInputView.markedTextRange || _backedTextInputView.isSecureTextEntry || fontHasBeenUpdatedBySystem;
979983

0 commit comments

Comments
 (0)