This code demonstrates the problem: the checkbox's focus ring is too large and off-center on macOS 14.5. (I haven't checked other macOS versions. Also note, this is not an iOS question.)
import SwiftUI
@main
struct CheckboxFocusRingBugApp: App {
var body: some Scene {
WindowGroup {
ContentView()
}
.windowResizability(.contentSize)
}
}
struct ContentView: View {
@State var text1: String = ""
@State var isOn1: Bool = true
let promptText: String = ""
var body: some View {
VStack(alignment: .leading, spacing: 12) {
HStack(alignment: .top) {
TextField(promptText, text: $text1)
.frame(width: 100)
Toggle("", isOn: $isOn1)
.toggleStyle(.checkbox)
}
}
.padding(16)
}
}
#Preview {
ContentView()
}
Is there a view modifier which will correct this, or is this just a glaring bug?