diff --git a/platforms/ios/example/WysiwygUITests/WysiwygUITests+Keyboard.swift b/platforms/ios/example/WysiwygUITests/WysiwygUITests+Keyboard.swift index 5d45d5165..28f296389 100644 --- a/platforms/ios/example/WysiwygUITests/WysiwygUITests+Keyboard.swift +++ b/platforms/ios/example/WysiwygUITests/WysiwygUITests+Keyboard.swift @@ -114,11 +114,19 @@ extension WysiwygUITests { app.keys["space"].tap() app.keys["more"].tap() app.keys["."].tap() - assertTextViewContent("hello how are you.") + + // This optimisation to predictive inline text was introduced in 17.5 + let correctText: String + if #available(iOS 17.5, *) { + correctText = "hello how are you." + } else { + correctText = "hello how are you ." + } + assertTextViewContent(correctText) // In the failure case a second dot is added in the tree. assertTreeEquals( """ - └>"hello how are you." + └>"\(correctText)" """ ) } diff --git a/platforms/ios/lib/WysiwygComposer/Sources/WysiwygComposer/Components/WysiwygComposerView/WysiwygComposerViewModel.swift b/platforms/ios/lib/WysiwygComposer/Sources/WysiwygComposer/Components/WysiwygComposerView/WysiwygComposerViewModel.swift index 72815408d..41a0e1863 100644 --- a/platforms/ios/lib/WysiwygComposer/Sources/WysiwygComposer/Components/WysiwygComposerView/WysiwygComposerViewModel.swift +++ b/platforms/ios/lib/WysiwygComposer/Sources/WysiwygComposer/Components/WysiwygComposerView/WysiwygComposerViewModel.swift @@ -467,6 +467,10 @@ public extension WysiwygComposerViewModel { /// accepting an inline predictive text suggestion. It then reconciles with the model if it did. /// - Returns: Whether the an update was applied. func updateDotAfterInlineTextPredicationIfNeeded() -> Bool { + // This optimisation to predictive inline text only came in in 17.5 + guard #available(iOS 17.5, *) else { + return false + } let text = textView.attributedText.htmlChars.withNBSP let textSelection = textView.selectedRange // Check if the last character in the editor is a dot.