I am having the following text field in content view:
func doCommit(){
print("\(self.status.textValue)")
}
var body : some View {
TextField("Your input:", text: self.$status.textValue, onCommit:{
self.doCommit()
}).lineLimit(1).focusable(true, onFocusChange: { focused in
print ("\(focused) changed")
})
...
}
When the text field got focus, and type return , the doCommit got called, which is what I want, but when I click on something else, and then click the text field and click somewhere else, the doCommit got called again, and the focusable onFocusChange is not call. I do not want the func been called when lost focus , but only when return/entry