Set the tab index when the expanded player is shown

This commit is contained in:
Jackson Harper 2022-10-21 16:11:13 +08:00
parent 0c7f5174c7
commit a59c9910a0

View file

@ -299,6 +299,9 @@
}.padding(.bottom, 16)
}
.padding(EdgeInsets(top: 0, leading: 0, bottom: 0, trailing: 0))
.onAppear {
self.tabIndex = audioController.currentAudioIndex
}
.onChange(of: audioController.state, perform: { state in
// Reset the tabIndex when we load a new audio item
if state == .loading {
@ -321,11 +324,11 @@
TextToSpeechLanguageView()
.navigationBarTitle("Language")
.navigationBarTitleDisplayMode(.inline)
.navigationBarItems(leading: Button(action: { self.showLanguageSheet = false }) {
.navigationBarItems(leading: Button(action: { self.showLanguageSheet = false }, label: {
Image(systemName: "chevron.backward")
.font(.appNavbarIcon)
.tint(.appGrayTextContrast)
})
}))
}
}
}