Select correct row for new entry regardless of sort order

This commit is contained in:
James Hurst
2014-08-06 07:40:03 -04:00
parent 5ff911b824
commit 6c9946a1b1

View File

@@ -377,7 +377,8 @@ NSString *const _MPTAbleSecurCellView = @"PasswordCell";
- (void)_didAddItem:(NSNotification *)notification {
MPDocument *document = [[self windowController] document];
NSInteger row = document.selectedGroup.entries.count - 1;
KPKEntry *entry = document.selectedGroup.entries.lastObject;
NSUInteger row = [self.entryArrayController.arrangedObjects indexOfObject:entry];
[self.entryTable scrollRowToVisible:row];
[self.entryTable selectRowIndexes:[NSIndexSet indexSetWithIndex:row] byExtendingSelection:NO];
}