From 42e3b2eb99eadf5ede98d52085ab27349e91bdff Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20B=C3=B6ttcher?= Date: Thu, 27 Jan 2022 19:56:01 +0100 Subject: [PATCH] entering multi select mode if row actions or search results are shown, hides the actions and the disables the search --- .../HomeView/HomeViewController+Multiselect.swift | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/Signal/src/ViewControllers/HomeView/HomeViewController+Multiselect.swift b/Signal/src/ViewControllers/HomeView/HomeViewController+Multiselect.swift index 5a42b167c3..bc26f1d992 100644 --- a/Signal/src/ViewControllers/HomeView/HomeViewController+Multiselect.swift +++ b/Signal/src/ViewControllers/HomeView/HomeViewController+Multiselect.swift @@ -24,6 +24,8 @@ extension HomeViewController { return } + // multi selection does not work well with displaying search results, so let's clear the search for now + searchBar.delegate?.searchBarCancelButtonClicked?(searchBar) viewState.multiSelectState.title = title if homeViewMode == .inbox { let doneButton = UIBarButtonItem(title: CommonStrings.cancelButton, style: .plain, target: self, action: #selector(done), accessibilityIdentifier: CommonStrings.cancelButton) @@ -492,6 +494,10 @@ public class MultiSelectState: NSObject { AssertIsOnMainThread() _isActive = active + // turn off current edit mode if necessary (removes leading and trailing actions) + if let tableView = tableView, active && tableView.isEditing { + tableView.setEditing(false, animated: true) + } if active || !actionPerformed { tableView?.setEditing(active, animated: true) } else if let tableView = tableView {