Workaround for #1786 - Disable auto correction when running on the Mac

This commit is contained in:
Stefan Ceriu
2024-10-03 13:31:36 +03:00
parent 318786762f
commit 481111193a

View File

@@ -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)