Skip to content

Commit 4cce9cf

Browse files
committed
Fix: TextField gray overlay when iOS app runs on macOS
Issue: When the iOS app is downloaded from the Mac App Store and run on Apple Silicon Macs, a gray overlay appears over TextField components when Increase Contrast accessibility setting is disabled. Reproduction: 1. Download bitchat iOS app from Mac App Store 2. Run on Apple Silicon Mac 3. Disable 'Increase Contrast' in System Settings > Accessibility > Display 4. Focus on text input field - gray overlay appears Fix: Use #if os(macOS) to disable autocorrection only when running on macOS. This targets the exact environment where the issue occurs while preserving normal autocorrection behavior for iPhone/iPad users.
1 parent 787386c commit 4cce9cf

1 file changed

Lines changed: 5 additions & 0 deletions

File tree

bitchat/Views/ContentView.swift

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ import SwiftUI
1111
import UIKit
1212
#endif
1313

14+
1415
// MARK: - Supporting Types
1516

1617
//
@@ -815,6 +816,10 @@ struct ContentView: View {
815816
.foregroundColor(textColor)
816817
.focused($isTextFieldFocused)
817818
.padding(.leading, 12)
819+
#if os(macOS)
820+
// Fix for gray overlay issue when iOS app runs on macOS with Increase Contrast disabled
821+
.autocorrectionDisabled(true)
822+
#endif
818823
// iOS keyboard autocomplete and capitalization enabled by default
819824
.onChange(of: messageText) { newValue in
820825
// Cancel previous debounce timer

0 commit comments

Comments
 (0)