diff --git a/RELEASE-NOTES.txt b/RELEASE-NOTES.txt index 0860a24c8ab84..e6b1377d07bf6 100644 --- a/RELEASE-NOTES.txt +++ b/RELEASE-NOTES.txt @@ -3,9 +3,11 @@ * Include block title in Unsupported block's UI * Show new-block-indicator when no blocks at all and when at the last block * Use existing links in the clipboard to prefill url field when inserting new link. +* [iOS] Fix issue where the keyboard would not capitalize sentences correctly on some cases. + 1.16.1 ------ -*[iOS] Fix tap on links bug that reappear on iOS 13.2 +* [iOS] Fix tap on links bug that reappear on iOS 13.2 1.16.0 ------ diff --git a/react-native-aztec/ios/RNTAztecView/RCTAztecView.swift b/react-native-aztec/ios/RNTAztecView/RCTAztecView.swift index b2e5ad12c0738..1112e306624ee 100644 --- a/react-native-aztec/ios/RNTAztecView/RCTAztecView.swift +++ b/react-native-aztec/ios/RNTAztecView/RCTAztecView.swift @@ -620,6 +620,16 @@ class RCTAztecView: Aztec.TextView { let caretData = packCaretDataForRN() onSelectionChange(caretData) } + + // MARK: - Selection + private func correctSelectionAfterLastEmptyLine() { + guard selectedTextRange?.start == endOfDocument, + let characterToReplaceLastEmptyLine = storage.htmlConverter.characterToReplaceLastEmptyLine, + text == String(characterToReplaceLastEmptyLine) else { + return + } + selectedTextRange = self.textRange(from: beginningOfDocument, to: beginningOfDocument) + } } // MARK: UITextView Delegate Methods @@ -630,9 +640,14 @@ extension RCTAztecView: UITextViewDelegate { return } + correctSelectionAfterLastEmptyLine() propagateSelectionChanges() } + func textViewDidBeginEditing(_ textView: UITextView) { + correctSelectionAfterLastEmptyLine() + } + func textViewDidChange(_ textView: UITextView) { guard isInsertingDictationResult == false else { return