Skip to content

Commit

Permalink
Reset search results when search is dismissed in ItemsViewController
Browse files Browse the repository at this point in the history
  • Loading branch information
mvasilak committed Jan 26, 2024
1 parent 7d451a1 commit 4a5a6ea
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions Zotero/Scenes/Detail/Items/Views/ItemsViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -587,6 +587,7 @@ final class ItemsViewController: UIViewController {
})
.disposed(by: disposeBag)
controller.obscuresBackgroundDuringPresentation = false
controller.delegate = self
navigationItem.hidesSearchBarWhenScrolling = false
navigationItem.searchController = controller
}
Expand Down Expand Up @@ -658,3 +659,9 @@ extension ItemsViewController: TagFilterDelegate {
self.updateTagFilter(with: self.viewModel.state)
}
}

extension ItemsViewController: UISearchControllerDelegate {
func didDismissSearchController(_ searchController: UISearchController) {
viewModel.process(action: .search(""))
}
}

0 comments on commit 4a5a6ea

Please sign in to comment.