mirror of
https://github.com/MacPass/MacPass.git
synced 2025-12-22 17:39:24 +00:00
Make selected textfield end editing when a save will occur (issue #203)
This commit is contained in:
@@ -125,7 +125,12 @@ typedef NS_ENUM(NSUInteger, MPEntryTab) {
|
||||
[[NSNotificationCenter defaultCenter] addObserver:self
|
||||
selector:@selector(_didAddEntry:)
|
||||
name:MPDocumentDidAddEntryNotification
|
||||
object:document];
|
||||
object:document];
|
||||
|
||||
[[NSNotificationCenter defaultCenter] addObserver:self
|
||||
selector:@selector(_willSave:)
|
||||
name:MPDocumentWillSaveNotification
|
||||
object:document];
|
||||
}
|
||||
|
||||
- (void)dealloc {
|
||||
@@ -439,4 +444,9 @@ typedef NS_ENUM(NSUInteger, MPEntryTab) {
|
||||
[self.titleTextField becomeFirstResponder];
|
||||
}
|
||||
|
||||
- (void)_willSave:(NSNotification *)notification {
|
||||
// Force selected textfield to end editing
|
||||
[[[self view] window] makeFirstResponder:nil];
|
||||
}
|
||||
|
||||
@end
|
||||
|
||||
Reference in New Issue
Block a user