Fix language sheet

This commit is contained in:
Thomas Ricouard 2024-01-21 18:27:55 +01:00
parent 9320b2f114
commit b7937e3580
1 changed files with 3 additions and 8 deletions

View File

@ -35,13 +35,8 @@ extension StatusEditor {
viewModel.setInitialLanguageSelection(preference: preferences.recentlyUsedLanguages.first ?? preferences.serverPreferences?.postLanguage) viewModel.setInitialLanguageSelection(preference: preferences.recentlyUsedLanguages.first ?? preferences.serverPreferences?.postLanguage)
} }
.accessibilityLabel("accessibility.editor.button.language") .accessibilityLabel("accessibility.editor.button.language")
.popover(isPresented: $isLanguageSheetDisplayed) { .sheet(isPresented: $isLanguageSheetDisplayed) {
if UIDevice.current.userInterfaceIdiom == .phone {
languageSheetView languageSheetView
} else {
languageSheetView
.frame(width: 400, height: 500)
}
} }
} }
@ -61,7 +56,7 @@ extension StatusEditor {
languageSheetSection(languages: languageSearchResult(query: languageSearch)) languageSheetSection(languages: languageSearchResult(query: languageSearch))
} }
} }
.searchable(text: $languageSearch) .searchable(text: $languageSearch, placement: .navigationBarDrawer)
.toolbar { .toolbar {
ToolbarItem(placement: .navigationBarLeading) { ToolbarItem(placement: .navigationBarLeading) {
Button("action.cancel", action: { isLanguageSheetDisplayed = false }) Button("action.cancel", action: { isLanguageSheetDisplayed = false })