mirror of
https://github.com/Novaloop-AG/element-x-ios.git
synced 2026-11-03 16:10:20 +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:
@@ -15,6 +15,7 @@ struct SearchScreenCoordinatorParameters {
|
||||
|
||||
enum SearchScreenCoordinatorAction {
|
||||
case presentRoom(roomID: String)
|
||||
case cancel
|
||||
}
|
||||
|
||||
final class SearchScreenCoordinator: CoordinatorProtocol {
|
||||
@@ -38,6 +39,8 @@ final class SearchScreenCoordinator: CoordinatorProtocol {
|
||||
switch action {
|
||||
case .presentRoom(let roomID):
|
||||
actionsSubject.send(.presentRoom(roomID: roomID))
|
||||
case .cancel:
|
||||
actionsSubject.send(.cancel)
|
||||
}
|
||||
}
|
||||
.store(in: &cancellables)
|
||||
|
||||
Reference in New Issue
Block a user