From b180202e0769d9cbc61f6c69fc406d10ad45a770 Mon Sep 17 00:00:00 2001 From: Maarten Billemont Date: Sun, 30 Apr 2017 18:54:07 -0400 Subject: [PATCH] Dismiss keyboard when dropping down preferences or app deactivates. --- platform-darwin/Source/iOS/MPPasswordsViewController.m | 1 + platform-darwin/Source/iOS/MPPopdownSegue.m | 1 + 2 files changed, 2 insertions(+) diff --git a/platform-darwin/Source/iOS/MPPasswordsViewController.m b/platform-darwin/Source/iOS/MPPasswordsViewController.m index b90d8fed..eabdbbe2 100644 --- a/platform-darwin/Source/iOS/MPPasswordsViewController.m +++ b/platform-darwin/Source/iOS/MPPasswordsViewController.m @@ -309,6 +309,7 @@ typedef NS_OPTIONS( NSUInteger, MPPasswordsTips ) { PearlRemoveNotificationObservers(); PearlAddNotificationObserver( UIApplicationWillResignActiveNotification, nil, [NSOperationQueue mainQueue], ^(MPPasswordsViewController *self, NSNotification *note) { + [self.view endEditing:YES]; self.passwordSelectionContainer.visible = NO; } ); PearlAddNotificationObserver( UIApplicationDidBecomeActiveNotification, nil, [NSOperationQueue mainQueue], diff --git a/platform-darwin/Source/iOS/MPPopdownSegue.m b/platform-darwin/Source/iOS/MPPopdownSegue.m index a42e2dc7..2859c402 100644 --- a/platform-darwin/Source/iOS/MPPopdownSegue.m +++ b/platform-darwin/Source/iOS/MPPopdownSegue.m @@ -38,6 +38,7 @@ metrics:nil views:NSDictionaryOfVariableBindings( popdownView )]; [passwordsVC.popdownToTopConstraint layoutIfNeeded]; + [passwordsVC.view endEditing:YES]; [UIView animateWithDuration:0.6f delay:0 usingSpringWithDamping:0.75f initialSpringVelocity:1 options:UIViewAnimationOptionCurveEaseOut animations:^{