What if they tap the submit button instead of hitting Done or Enter?

For https://developer.apple.com/videos/play/wwdc2021/10023/?time=411 I have a similar case in my app, but SwiftUI doesn't seem to be able to sanely handle the case where the user hits the submit button after typing instead of hitting Return or the "Done" button like they do in the video. In my case I have a focus listener on the Textfield and want to perform a custom action when the Textfield loses focus. If they manually hit the submit button in the UI instead of using the keyboard, the textfield doesn't lose focus or at least the handler isn't called. Is there some way to make sure that the lose focus handler is called on the text field when they tap the submit without a bunch of kludgey code creating dependencies between the components?