Skip to content
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 18 additions & 0 deletions bitchat/Views/ContentView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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

//
Expand Down Expand Up @@ -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
Expand Down