I have a TabView with three TabItems. When I press a Button on the first TabItem, I then want to disable the user's ability to tap and go to TabItem two and three.
I've used disabled(), but I can still tap and go to them.
TabView(selection: $tabSelected) {
MeditationTimer(vm: vm)
.tabItem({
Label("Meditate", systemImage: "timer")
})
.tag(0)
History(vm: vm)
.tabItem {
Label("Sessions", systemImage: "list.bullet")
}
.tag(1)
.disabled(vm.isActive)
Settings(vm: vm)
.tabItem {
Label("Settings", systemImage: "gearshape")
}
.tag(2)
.disabled(vm.isActive)
}
Putting .disabled() on TabView itself actually works, but yeah, then nothing can be tapped in my whole app anymore. Like the stop button on the first TabItem.
Any help is greatly appreciated!