Cannot use TextEditor in .plain Window

When creating a plain window in SwiftUI on macOS 15.0 beta, the TextEditor within the window does not accept keyboard input. I suspect it's because plain windows cannot become key windows.

Here is a minimal example:

import SwiftUI

struct ContentView: View {
    @State var text: String = "Hello World"

    var body: some View {
        VStack {
            TextEditor(text: $text)
        }
    }
}

@main
struct BigTextApp: App {
    var body: some Scene {
        Window("Text Window", id: "TextWindow") {
            ContentView()
        }
        .windowStyle(.plain)
    }
}

Attempting to type gives the following warning in Xcode: Warning: -[NSWindow makeKeyWindow] called on SwiftUI.AppKitWindow which returned NO from -[NSWindow canBecomeKeyWindow].

Is there a way to make the window capable of becoming a key window without dropping down to UIKit? Or is there another way to allow the TextEditor to accept keyboard input?

I have tried focusing the TextEditor, but that didn't work.

Can you please file a bug report regarding the behaviors you're seeing here? Once you open the bug report, please post the FB number here for my reference.

If you have any questions about filing a bug report, take a look at Bug Reporting: How and Why?

I submitted it as a macOS bug, I hope that's alright. The FB number is FB13908387.

Cannot use TextEditor in .plain Window
 
 
Q