diff --git a/bitchat/Views/ContentView.swift b/bitchat/Views/ContentView.swift index 3bd6f3020..1c3256af3 100644 --- a/bitchat/Views/ContentView.swift +++ b/bitchat/Views/ContentView.swift @@ -11,6 +11,20 @@ import SwiftUI import UIKit #endif +#if os(iOS) +@available(iOS 14.0, *) +struct IOSOnMacFixModifier: ViewModifier { + func body(content: Content) -> some View { + if ProcessInfo.processInfo.isiOSAppOnMac { + content + .autocorrectionDisabled(true) + } else { + content + } + } +} +#endif + // MARK: - Supporting Types // @@ -771,6 +785,10 @@ struct ContentView: View { .foregroundColor(textColor) .focused($isTextFieldFocused) .padding(.leading, 12) + #if os(iOS) + // Fix for gray overlay issue when iOS app runs on macOS with Increase Contrast disabled + .modifier(IOSOnMacFixModifier()) + #endif // iOS keyboard autocomplete and capitalization enabled by default .onChange(of: messageText) { newValue in // Cancel previous debounce timer