In my app I have a TabView with lists in there. When I scroll a list and than change tabs forth and back, the list is always reset and starts from the top...
But this shouldn't be the case... Is this a bug, or what I'm doing wrong?
Here is some example code:
struct ContentView: View {
var body: some View {
TabView {
NavigationView {
List {
ForEach((1...50), id: \.self) {
Text("Row in Tab 1 Number: \($0)")
}
}
.navigationBarTitle("Tab 1")
}.tabItem {
Image(systemName: "bubble.right")
Text("Tab 1")
}.tag(0)
NavigationView {
List {
ForEach((1...50), id: \.self) {
Text("Row in Tab 2 Number: \($0)")
}
}
.navigationBarTitle("Tab 2")
}.tabItem {
Image(systemName: "bubble.left")
Text("Tab 2")
}.tag(1)
}.edgesIgnoringSafeArea(.top)
}
}
Hope someone can help me on this.
Thanks,
Stefan