Skip to content
Snippets Groups Projects
Commit 4b93b222 authored by Bruno Muniz's avatar Bruno Muniz :apple:
Browse files

fix keyboard dismissing when hud shows up

parent f135a7af
No related branches found
No related tags found
1 merge request!81Fix keyboard remaining up when hud is being displayed
...@@ -14,6 +14,7 @@ public struct HUDModel { ...@@ -14,6 +14,7 @@ public struct HUDModel {
content: String? = nil, content: String? = nil,
actionTitle: String? = nil, actionTitle: String? = nil,
hasDotAnimation: Bool = false, hasDotAnimation: Bool = false,
isAutoDismissable: Bool = false,
onTapClosure: (() -> Void)? = nil onTapClosure: (() -> Void)? = nil
) { ) {
self.title = title self.title = title
...@@ -21,7 +22,7 @@ public struct HUDModel { ...@@ -21,7 +22,7 @@ public struct HUDModel {
self.actionTitle = actionTitle self.actionTitle = actionTitle
self.onTapClosure = onTapClosure self.onTapClosure = onTapClosure
self.hasDotAnimation = hasDotAnimation self.hasDotAnimation = hasDotAnimation
self.isAutoDismissable = onTapClosure == nil && !hasDotAnimation self.isAutoDismissable = isAutoDismissable
} }
public init( public init(
......
...@@ -68,6 +68,7 @@ public final class RootViewController: UIViewController { ...@@ -68,6 +68,7 @@ public final class RootViewController: UIViewController {
return return
} }
add(hudView: HUDView().setup(model: model)) add(hudView: HUDView().setup(model: model))
view.endEditing(true)
}.store(in: &cancellables) }.store(in: &cancellables)
} }
} }
......
...@@ -66,6 +66,7 @@ final class SearchLeftViewModel { ...@@ -66,6 +66,7 @@ final class SearchLeftViewModel {
hudManager.show(.init( hudManager.show(.init(
actionTitle: Localized.Ud.Search.cancel, actionTitle: Localized.Ud.Search.cancel,
hasDotAnimation: true, hasDotAnimation: true,
isAutoDismissable: false,
onTapClosure: { [weak self] in onTapClosure: { [weak self] in
guard let self else { return } guard let self else { return }
self.didTapCancelSearch() self.didTapCancelSearch()
...@@ -114,6 +115,7 @@ final class SearchLeftViewModel { ...@@ -114,6 +115,7 @@ final class SearchLeftViewModel {
hudManager.show(.init( hudManager.show(.init(
actionTitle: Localized.Ud.Search.cancel, actionTitle: Localized.Ud.Search.cancel,
hasDotAnimation: true, hasDotAnimation: true,
isAutoDismissable: false,
onTapClosure: { [weak self] in onTapClosure: { [weak self] in
guard let self else { return } guard let self else { return }
self.didTapCancelSearch() self.didTapCancelSearch()
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment