diff --git a/Tusker/Screens/FindInstanceViewController.swift b/Tusker/Screens/FindInstanceViewController.swift index 9526dd8988..f49a2c45e7 100644 --- a/Tusker/Screens/FindInstanceViewController.swift +++ b/Tusker/Screens/FindInstanceViewController.swift @@ -37,7 +37,14 @@ class FindInstanceViewController: InstanceSelectorTableViewController { // MARK: - Interaction @objc func cancelButtonPressed() { - dismiss(animated: true) + // when the search controller is active, dismiss exits it rather than dismissing ourself, so we have to dismiss twice + if searchController.isActive { + dismiss(animated: false) { + self.dismiss(animated: true) + } + } else { + dismiss(animated: true) + } } }