Fix back button not selecting settings item
This commit is contained in:
parent
c44ba521e2
commit
ba5c0a97c5
@ -155,7 +155,7 @@ public struct NavigationView<Item>: WinUIWidget where Item: NavigationViewItem {
|
||||
if selectedItem != .custom(item: item) {
|
||||
selectedItem = .custom(item: item)
|
||||
}
|
||||
} else {
|
||||
} else if selectedItem != .settings {
|
||||
selectedItem = .settings
|
||||
}
|
||||
}
|
||||
@ -205,7 +205,7 @@ public struct NavigationView<Item>: WinUIWidget where Item: NavigationViewItem {
|
||||
navigationView.paneDisplayMode = mode.winMode
|
||||
}
|
||||
if case .settings = selectedItem {
|
||||
navigationView.isSettingsVisible = true
|
||||
navigationView.selectedItem = navigationView.settingsItem
|
||||
} else if case let .custom(name) = selectedItem {
|
||||
navigationView.selectedItem = navigationView.menuItems
|
||||
.first { ($0 as? WinUI.NavigationViewItem)?.name as? String == name.description } as Any?
|
||||
|
Loading…
Reference in New Issue
Block a user