diff --git a/Tusker/Screens/FindInstanceViewController.swift b/Tusker/Screens/FindInstanceViewController.swift index 9526dd89..f49a2c45 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) + } } }