From bc79f22e22ebb526a7837b009cc618f86d8abd31 Mon Sep 17 00:00:00 2001 From: Kyle Spearrin Date: Mon, 24 Sep 2018 14:51:37 -0400 Subject: [PATCH] implement search delegate --- src/iOS.Autofill/LoginSearchViewController.cs | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/src/iOS.Autofill/LoginSearchViewController.cs b/src/iOS.Autofill/LoginSearchViewController.cs index 0a7af7f03..b7659a4f7 100644 --- a/src/iOS.Autofill/LoginSearchViewController.cs +++ b/src/iOS.Autofill/LoginSearchViewController.cs @@ -34,6 +34,7 @@ namespace Bit.iOS.Autofill TableView.RowHeight = UITableView.AutomaticDimension; TableView.EstimatedRowHeight = 44; TableView.Source = new TableSource(this); + SearchBar.Delegate = new SearchDelegate(this); await ((TableSource)TableView.Source).LoadItemsAsync(false, SearchBar.Text); } @@ -76,7 +77,7 @@ namespace Bit.iOS.Autofill private LoginSearchViewController _controller; public TableSource(LoginSearchViewController controller) - :base(controller.Context, controller) + : base(controller.Context, controller) { _context = controller.Context; _controller = controller; @@ -158,4 +159,19 @@ namespace Bit.iOS.Autofill } } } + + public class SearchDelegate : UISearchBarDelegate + { + private readonly LoginSearchViewController _controller; + + public SearchDelegate(LoginSearchViewController controller) + { + _controller = controller; + } + + public override void OnEditingStopped(UISearchBar searchBar) + { + base.OnEditingStopped(searchBar); + } + } }