Post

Replies

Boosts

Views

Activity

Reply to SwiftUI TextField on macos hit `return` key won't resign responder, instead select all text?
I found a similar case here How can I remove Textfield focus when I press return or click outside Textfield? (SwiftUI, MacOS) - https://stackoverflow.com/questions/58987542/how-can-i-remove-textfield-focus-when-i-press-return-or-click-outside-textfield,with the following code swift    func onCommit() - Void {     DispatchQueue.main.async {       NSApp.keyWindow?.makeFirstResponder(nil)     }   } It's almost what I want, except that, after I press return key, I can see the selection flash and quickly disappear.
Apr ’21