From a59c9910a0669b59132f1e8c3e2d866463cf1b23 Mon Sep 17 00:00:00 2001 From: Jackson Harper Date: Fri, 21 Oct 2022 16:11:13 +0800 Subject: [PATCH] Set the tab index when the expanded player is shown --- .../Sources/App/Views/AudioPlayer/ExpandedPlayer.swift | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/apple/OmnivoreKit/Sources/App/Views/AudioPlayer/ExpandedPlayer.swift b/apple/OmnivoreKit/Sources/App/Views/AudioPlayer/ExpandedPlayer.swift index a81abec01..f6d20c9f0 100644 --- a/apple/OmnivoreKit/Sources/App/Views/AudioPlayer/ExpandedPlayer.swift +++ b/apple/OmnivoreKit/Sources/App/Views/AudioPlayer/ExpandedPlayer.swift @@ -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) - }) + })) } } }