SwiftUI: TextField focus ring

How do I remove focus ring from TextField on macOS using SwiftUI?

Replies

I was also looking for this functionality but the answer is you can't at this time. If you are looking to get a search field like behaviour where the search magnifier is located inside of the focus you can not get the exact behaviour. The best solution I got so far is to copy a magnifier form SF Symbols in the label of a TextField. With this solution it looks nearly the same but the magnifier goes out of the way if the user starts typing (maybe even better as the original solution, of course without a search menu attached). Another option I tried is to use a TextEditor by monitoring with onChange on TAB and RETURN to resign the first responder. Unfortunately I failed to resign the responser. Only option was to send keyboard events but this would require user permissions.
I've also asked this question (slightly differently) months ago and managed to solve it.
See the response to my question here.