From 481111193ac261f6a12545160fcf5fb24bd323f2 Mon Sep 17 00:00:00 2001 From: Stefan Ceriu Date: Thu, 3 Oct 2024 13:31:36 +0300 Subject: [PATCH] Workaround for #1786 - Disable auto correction when running on the Mac --- .../ComposerToolbar/View/MessageComposerTextField.swift | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/ElementX/Sources/Screens/RoomScreen/ComposerToolbar/View/MessageComposerTextField.swift b/ElementX/Sources/Screens/RoomScreen/ComposerToolbar/View/MessageComposerTextField.swift index 05469baf1..a1f73a001 100644 --- a/ElementX/Sources/Screens/RoomScreen/ComposerToolbar/View/MessageComposerTextField.swift +++ b/ElementX/Sources/Screens/RoomScreen/ComposerToolbar/View/MessageComposerTextField.swift @@ -79,6 +79,12 @@ private struct UITextViewWrapper: UIViewRepresentable { textView.textContainer.lineFragmentPadding = 0.0 textView.textContainerInset = .zero textView.keyboardType = .default + + // AutoCorrection doesn't work properly when running on the Mac + // https://github.com/element-hq/element-x-ios/issues/1786 + if ProcessInfo.processInfo.isiOSAppOnMac { + textView.autocorrectionType = .no + } textView.setContentCompressionResistancePriority(.defaultLow, for: .horizontal)