This can happen if you're using NavigationStack in your app and you enter a view without using it, for example I was making a form appear in a .sheet{}, and if I did something like this the toolbar wouldn't work on any TextField inside the .sheet:
.sheet(isPresented: $showUploadSheet, content: {
PhotoUploadView()
})
But if I wrapped it in a NavigationStack like this, then it would start working.
.sheet(isPresented: $showUploadSheet, content: {
NavigationStack {
PhotoUploadView()
}
})
One last thing is that this method does not work if you use a .fullScreenCover{} instead of a .sheet{}
I'm not sure why, it would be nice if it did.
Topic:
UI Frameworks
SubTopic:
SwiftUI
Tags: