From 05d4381045141c07456242382b2f2310076901d8 Mon Sep 17 00:00:00 2001 From: Michael Starke Date: Fri, 29 Oct 2021 14:21:11 +0200 Subject: [PATCH] Fixed missing selection update, when search yields results --- MacPass/MPEntryViewController.m | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/MacPass/MPEntryViewController.m b/MacPass/MPEntryViewController.m index 15576aa3..86e1e613 100644 --- a/MacPass/MPEntryViewController.m +++ b/MacPass/MPEntryViewController.m @@ -409,7 +409,7 @@ NSString *const _MPTableSecurCellView = @"PasswordCell"; return; // Not the right table view } /* do not update the current item if we are not in focus! */ - if(tableView.window.firstResponder == self.entryTable) { + if(self.displayMode == MPDisplayModeSearchResults || tableView.window.firstResponder == self.entryTable) { MPDocument *document = self.windowController.document; document.selectedEntries = self.entryArrayController.selectedObjects; } @@ -509,7 +509,7 @@ NSString *const _MPTableSecurCellView = @"PasswordCell"; - (void)_didUpdateSearchResults:(NSNotification *)notification { NSArray *result = notification.userInfo[kMPDocumentSearchResultsKey]; - NSAssert(result != nil, @"Resutls should never be nil"); + NSAssert(result != nil, @"Results should never be nil"); self.filteredEntries = result; self.entryArrayController.content = self.filteredEntries; [self.entryTable tableColumnWithIdentifier:MPEntryTableParentColumnIdentifier].hidden = NO; @@ -529,6 +529,7 @@ NSString *const _MPTableSecurCellView = @"PasswordCell"; - (void)_didEnterSearch:(NSNotification *)notification { self.displayMode = MPDisplayModeSearchResults; + // FIXME: update selection? [self _updateContextBar]; }