mirror of
https://github.com/Dimillian/IceCubesApp.git
synced 2024-11-26 18:21:00 +00:00
FIXES issue#1200 (#1297)
This commit is contained in:
parent
ffe9e7a714
commit
044d3b6b84
1 changed files with 10 additions and 0 deletions
|
@ -97,6 +97,9 @@ struct SideBarView<Content: View>: View {
|
|||
private var tabsView: some View {
|
||||
ForEach(tabs) { tab in
|
||||
Button {
|
||||
//ensure keyboard is always dismissed when selecting a tab
|
||||
hideKeyboard()
|
||||
|
||||
if tab == selectedTab {
|
||||
popToRootTab = .other
|
||||
DispatchQueue.main.asyncAfter(deadline: .now() + 0.01) {
|
||||
|
@ -171,3 +174,10 @@ private struct SideBarIcon: View {
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
extension View {
|
||||
func hideKeyboard() {
|
||||
let resign = #selector(UIResponder.resignFirstResponder)
|
||||
UIApplication.shared.sendAction(resign, to: nil, from: nil, for: nil)
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue