mirror of
https://github.com/Novaloop-AG/element-x-ios.git
synced 2026-11-02 21:33:26 +00:00
Allow returning from global search with the escape key
cmd+k jumps to the search tab but left users with no way back. Pressing escape in the search field now returns to the tab they came from (never into search itself). Escape is handled at the search field's pressesBegan, alongside the existing arrow-key navigation, since the focused UIKit field swallows SwiftUI keyboard shortcuts.
This commit is contained in:
@@ -100,7 +100,16 @@ import SwiftUI
|
||||
}
|
||||
|
||||
/// The currently selected tab's tag.
|
||||
var selectedTab: Tag?
|
||||
var selectedTab: Tag? {
|
||||
didSet {
|
||||
if oldValue != selectedTab {
|
||||
previousTab = oldValue
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// The tab that was selected before the current one, used to return to it (e.g. cancelling search).
|
||||
private(set) var previousTab: Tag?
|
||||
|
||||
// MARK: Sheets
|
||||
|
||||
|
||||
Reference in New Issue
Block a user