TextEditor hide keyboard with submit button

You should make it more clear that this is a SwiftUI question

Anyhow, TextEditor doesn't have an .onSubmit() so you can't use that. You can use onChange(of: and check if the last character entered is a new line and remove focus when so

Kinda like this (not taking care of captures):

struct ContentView: View {
    @State var text: String
    @FocusState private var isFocused: Bool

    var body: some View {
        VStack {
            TextEditor(text: $text)
                .onChange(of: text) { _ in
                    if text.last?.isNewline == .some(true) {
                        text.removeLast()
                        isFocused = false
                    }
                }
                .focused($isFocused)
                .submitLabel(.done)
        }
        .padding()
    }
}

However depending on what you're after, you might want to use TextField instead. TextEditor is supposed to allow the user to enter any text they want, including new lines and by having a done button you're preventing them from doing so

If you want TextField with line wrapping you do axis: .vertical but then you have the same problem now software keyboard return adds a new line. Weirdly hardware keyboard return submits.

SwiftUI is rendering a UITextView and not UITextField when axis is vertical so maybe something to do with that.

This is a question about using Apple's SwiftUI platform framework, and it should really be asked / answered over at the Apple developer forums.