Ensure the input toolbar is visible after searching

This commit is contained in:
Nora Trapp 2019-10-05 17:58:45 -07:00
parent 59d5b5d591
commit 1e78d13571
2 changed files with 18 additions and 7 deletions

View File

@ -1308,8 +1308,7 @@ NSString *const kArchiveButtonPseudoGroup = @"kArchiveButtonPseudoGroup";
{
self.searchBar.text = nil;
[self.searchBar resignFirstResponder];
OWSAssertDebug(!self.searchBar.isFirstResponder);
[self dismissSearchKeyboard];
[self updateSearchResultsVisibility];
@ -1348,20 +1347,27 @@ NSString *const kArchiveButtonPseudoGroup = @"kArchiveButtonPseudoGroup";
[self.tableView setContentOffset:CGPointMake(0, -topInset) animated:isAnimated];
}
- (void)dismissSearchKeyboard
{
[self.searchBar resignFirstResponder];
OWSAssertDebug(!self.searchBar.isFirstResponder);
// If we have a visible conversation, restore its first responder status so the input toolbar renders.
[self.conversationSplitViewController.selectedConversationViewController becomeFirstResponder];
}
#pragma mark - UIScrollViewDelegate
- (void)scrollViewWillBeginDragging:(UIScrollView *)scrollView
{
[self.searchBar resignFirstResponder];
OWSAssertDebug(!self.searchBar.isFirstResponder);
[self dismissSearchKeyboard];
}
#pragma mark - ConversationSearchViewDelegate
- (void)conversationSearchViewWillBeginDragging
{
[self.searchBar resignFirstResponder];
OWSAssertDebug(!self.searchBar.isFirstResponder);
[self dismissSearchKeyboard];
}
#pragma mark - HomeFeedTableViewCellDelegate
@ -1447,7 +1453,8 @@ NSString *const kArchiveButtonPseudoGroup = @"kArchiveButtonPseudoGroup";
{
OWSLogInfo(@"%ld %ld", (long)indexPath.row, (long)indexPath.section);
[self.searchBar resignFirstResponder];
[self dismissSearchKeyboard];
ConversationListViewControllerSection section = (ConversationListViewControllerSection)indexPath.section;
switch (section) {
case ConversationListViewControllerSectionReminders: {

View File

@ -42,6 +42,10 @@ class ConversationSplitViewController: UISplitViewController {
return Theme.isDarkThemeEnabled ? .lightContent : .default
}
override var canBecomeFirstResponder: Bool {
return false
}
@objc
func showNewConversationView() {
conversationListVC.showNewConversationView()