diff options
| -rw-r--r-- | ios/MullvadVPN/View controllers/SelectLocation/Views/FloatingSearchBar.swift | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/ios/MullvadVPN/View controllers/SelectLocation/Views/FloatingSearchBar.swift b/ios/MullvadVPN/View controllers/SelectLocation/Views/FloatingSearchBar.swift index bdc02afbb4..6984416b0c 100644 --- a/ios/MullvadVPN/View controllers/SelectLocation/Views/FloatingSearchBar.swift +++ b/ios/MullvadVPN/View controllers/SelectLocation/Views/FloatingSearchBar.swift @@ -22,6 +22,14 @@ struct FloatingSearchBar: View { .textInputAutocapitalization(.never) .focused(isFocused) .foregroundColor(.MullvadTextField.textInput) + .onSubmit { + if searchText.isEmpty { + withAnimation { + isExpanded = false + isFocused.wrappedValue = false + } + } + } } .padding(.horizontal, 16) .frame(height: 56) |
