Skip to content
Snippets Groups Projects
Commit 9f42e61d authored by Kateryna Kostiuk's avatar Kateryna Kostiuk
Browse files

conversation: fix search bar behaviour

Pressing the search button on the keyboard should
preserve filtered results until 'Cancel' is pressed.

Change-Id: Id2a95ceb6f699ff8dd808d4e83cb12e945c27e5b
parent 422262d1
No related branches found
No related tags found
No related merge requests found
......@@ -70,7 +70,6 @@ private struct SearchBar: UIViewControllerRepresentable {
searchController.searchResultsUpdater = self
searchController.searchBar.searchTextField.addTarget(self, action: #selector(searchBarTextDidBeginEditing(_:)), for: .editingDidBegin)
searchController.searchBar.searchTextField.addTarget(self, action: #selector(searchBarTextDidEndEditing(_:)), for: .editingDidEnd)
searchController.hidesNavigationBarDuringPresentation = true
searchController.obscuresBackgroundDuringPresentation = false
searchController.searchBar.searchTextField.accessibilityIdentifier = SmartListAccessibilityIdentifiers.searchBarTextField
......@@ -97,15 +96,6 @@ private struct SearchBar: UIViewControllerRepresentable {
}
}
@objc
private func searchBarTextDidEndEditing(_ textField: UITextField) {
DispatchQueue.main.async {
withAnimation {
self.isActive = false
}
}
}
func updateSearchResults(for searchController: UISearchController) {
// DispatchQueue.main.async is important to avoid "Modifying state during view update, this will cause undefined behavior." error
DispatchQueue.main.async {
......
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