From a347474437895ba92cf2359aa95c2af4acb70c1c Mon Sep 17 00:00:00 2001 From: Arkadiusz Fal Date: Tue, 9 Aug 2022 21:14:05 +0200 Subject: [PATCH] Hide keyboard on navigation --- Model/NavigationModel.swift | 5 +++++ Model/Player/PlayerModel.swift | 2 ++ 2 files changed, 7 insertions(+) diff --git a/Model/NavigationModel.swift b/Model/NavigationModel.swift index 11dff244..06770bb3 100644 --- a/Model/NavigationModel.swift +++ b/Model/NavigationModel.swift @@ -93,6 +93,7 @@ final class NavigationModel: ObservableObject { return } + navigation.hideKeyboard() player.hide() navigation.presentingChannel = false @@ -130,6 +131,8 @@ final class NavigationModel: ObservableObject { player.hide() #endif + navigation.hideKeyboard() + DispatchQueue.main.asyncAfter(deadline: .now() + 0.2) { recents.add(recent) @@ -156,6 +159,8 @@ final class NavigationModel: ObservableObject { navigation.presentingPlaylist = false navigation.tabSelection = .search + navigation.hideKeyboard() + if let searchQuery = searchQuery { let recent = RecentItem(from: searchQuery) recents.add(recent) diff --git a/Model/Player/PlayerModel.swift b/Model/Player/PlayerModel.swift index c95a0c5d..4a195f44 100644 --- a/Model/Player/PlayerModel.swift +++ b/Model/Player/PlayerModel.swift @@ -202,6 +202,8 @@ final class PlayerModel: ObservableObject { } #endif + navigation.hideKeyboard() + DispatchQueue.main.async { [weak self] in withAnimation(.linear(duration: 0.25)) { self?.presentingPlayer = true