macOS 12 sets the TextField as first responder on launch for a few seconds before this changes.
Tried calling the methods below onAppear, didFinishLaunching, willFinishLaunching, init() of the main app
NSApp.keyWindow?.makeFirstResponder(nil)
NSApp.keyWindow?.resignFirstResponder()
There is a brief delay of a few seconds before the app automatically removes focus.
How to prevent this behaviour ? I have some animations which are triggered when the TextField is focused.
I'm using
enum Focus { case some, none }
@FocusState var focus : Focus
I've observed that on launch focus is set to some and then to nil