Has anybody experienced anything like this? This is just an example view, but every search bar in my app is like this.
#SwiftLang #SwiftUI
Ok, multiple things going on.
1. It seems, despite what the documentation says, you have to put the .searchable() modifier *on* the Navigation(View/Stack) and not on a view inside it. Putting it on a view inside it _does_ make the search bar appear, but typing in it will be impossible.
#SwiftUI
2. It seems that *Anything* that causes the navigation bar to rerender will cause the same behavior. In one case, I had a conditional in a .toolbar modifier. In another case, I had .navigationBarTitleDisplayMode(.inline) modifier on the ForEach inside a List. I moved it to the List itself. Started working. Ugh...🙄
#SwiftUI