SwiftUI on macOS, TextField inside List is completely non-functional

If I use a TextField inside of a List, being able to actually focus on this text field is a nightmare. Sometimes, if you click just right, (seems to be single click and patiently wait), you will be able to actually focus and edit the text. Many times it just doesn't focus.

Obviously, a user does not expect to fight a text field for focus. It should be clicked and immediately focused on. Not perhaps focused on in the next second or two if the system feels like it.

What am I missing here? Does this just not work?

This is reproducible in the simplest test case of literally just trying:

Code Block
@State var test = "Blah"
List {
TextField("foobar", text: $test)
}

Answered by samuelhorwitz in 667574022
Okay I think I see what the intention is here, it appears the goal is that a text field inside of a list is supposed to work the way a click to rename action would work.

Since this is my intended use case, I was overdoing it by switching out Text for TextField when the user tapped, which is actually better done just using TextField and letting it handle the single click/wait/rename thing.
Accepted Answer
Okay I think I see what the intention is here, it appears the goal is that a text field inside of a list is supposed to work the way a click to rename action would work.

Since this is my intended use case, I was overdoing it by switching out Text for TextField when the user tapped, which is actually better done just using TextField and letting it handle the single click/wait/rename thing.
SwiftUI on macOS, TextField inside List is completely non-functional
 
 
Q