focus search after content results are set

This commit is contained in:
Kyle Spearrin 2017-11-27 22:49:27 -05:00
parent 155b8b472f
commit 615a7670bd

View file

@ -270,12 +270,6 @@ namespace Bit.App.Pages
Search.TextChanged += SearchBar_TextChanged; Search.TextChanged += SearchBar_TextChanged;
Search.SearchButtonPressed += SearchBar_SearchButtonPressed; Search.SearchButtonPressed += SearchBar_SearchButtonPressed;
_filterResultsCancellationTokenSource = FetchAndLoadVault(); _filterResultsCancellationTokenSource = FetchAndLoadVault();
if(string.IsNullOrWhiteSpace(_uri) && !_folder && string.IsNullOrWhiteSpace(_folderId) &&
string.IsNullOrWhiteSpace(_collectionId) && !_favorites)
{
Search.FocusWithDelay(forceDelay: true);
}
} }
protected override void OnDisappearing() protected override void OnDisappearing()
@ -353,6 +347,12 @@ namespace Bit.App.Pages
if(PresentationSections.Count > 0 || !string.IsNullOrWhiteSpace(Search.Text)) if(PresentationSections.Count > 0 || !string.IsNullOrWhiteSpace(Search.Text))
{ {
Content = ResultsStackLayout; Content = ResultsStackLayout;
if(string.IsNullOrWhiteSpace(_uri) && !_folder && string.IsNullOrWhiteSpace(_folderId) &&
string.IsNullOrWhiteSpace(_collectionId) && !_favorites)
{
Search.Focus();
}
} }
else if(_syncService.SyncInProgress) else if(_syncService.SyncInProgress)
{ {